summaryrefslogtreecommitdiff
path: root/drivers/platform/loongarch
diff options
context:
space:
mode:
authorHuacai Chen <chenhuacai@loongson.cn>2022-10-29 11:29:31 +0300
committerHuacai Chen <chenhuacai@loongson.cn>2022-10-29 11:29:31 +0300
commitbbfddb904df6f82a5948687a2d57766216b9bc0f (patch)
treebe7f106d8cfc5bd7978beecd03f6c30df684af5b /drivers/platform/loongarch
parent4805a13d54be3f5e06436d41fdb13f24012a3c6c (diff)
downloadlinux-bbfddb904df6f82a5948687a2d57766216b9bc0f.tar.xz
LoongArch: BPF: Avoid declare variables in switch-case
Not all compilers support declare variables in switch-case, so move declarations to the beginning of a function. Otherwise we may get such build errors: arch/loongarch/net/bpf_jit.c: In function ‘emit_atomic’: arch/loongarch/net/bpf_jit.c:362:3: error: a label can only be part of a statement and a declaration is not a statement u8 r0 = regmap[BPF_REG_0]; ^~ arch/loongarch/net/bpf_jit.c: In function ‘build_insn’: arch/loongarch/net/bpf_jit.c:727:3: error: a label can only be part of a statement and a declaration is not a statement u8 t7 = -1; ^~ arch/loongarch/net/bpf_jit.c:778:3: error: a label can only be part of a statement and a declaration is not a statement int ret; ^~~ arch/loongarch/net/bpf_jit.c:779:3: error: expected expression before ‘u64’ u64 func_addr; ^~~ arch/loongarch/net/bpf_jit.c:780:3: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement] bool func_addr_fixed; ^~~~ arch/loongarch/net/bpf_jit.c:784:11: error: ‘func_addr’ undeclared (first use in this function); did you mean ‘in_addr’? &func_addr, &func_addr_fixed); ^~~~~~~~~ in_addr arch/loongarch/net/bpf_jit.c:784:11: note: each undeclared identifier is reported only once for each function it appears in arch/loongarch/net/bpf_jit.c:814:3: error: a label can only be part of a statement and a declaration is not a statement u64 imm64 = (u64)(insn + 1)->imm << 32 | (u32)insn->imm; ^~~ Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Diffstat (limited to 'drivers/platform/loongarch')
0 files changed, 0 insertions, 0 deletions