Skip to content

Commit 343a3e8

Browse files
arndbborkmann
authored andcommitted
bpf: Fix -Wshadow warnings
There are thousands of warnings about one macro in a W=2 build: include/linux/filter.h:561:6: warning: declaration of 'ret' shadows a previous local [-Wshadow] Prefix all the locals in that macro with __ to avoid most of these warnings. Fixes: 492ecee ("bpf: enable program stats") Signed-off-by: Arnd Bergmann <[email protected]> Signed-off-by: Daniel Borkmann <[email protected]> Acked-by: Andrii Nakryiko <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
1 parent 4725477 commit 343a3e8

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

include/linux/filter.h

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -558,21 +558,21 @@ struct sk_filter {
558558
DECLARE_STATIC_KEY_FALSE(bpf_stats_enabled_key);
559559

560560
#define __BPF_PROG_RUN(prog, ctx, dfunc) ({ \
561-
u32 ret; \
561+
u32 __ret; \
562562
cant_migrate(); \
563563
if (static_branch_unlikely(&bpf_stats_enabled_key)) { \
564-
struct bpf_prog_stats *stats; \
565-
u64 start = sched_clock(); \
566-
ret = dfunc(ctx, (prog)->insnsi, (prog)->bpf_func); \
567-
stats = this_cpu_ptr(prog->aux->stats); \
568-
u64_stats_update_begin(&stats->syncp); \
569-
stats->cnt++; \
570-
stats->nsecs += sched_clock() - start; \
571-
u64_stats_update_end(&stats->syncp); \
564+
struct bpf_prog_stats *__stats; \
565+
u64 __start = sched_clock(); \
566+
__ret = dfunc(ctx, (prog)->insnsi, (prog)->bpf_func); \
567+
__stats = this_cpu_ptr(prog->aux->stats); \
568+
u64_stats_update_begin(&__stats->syncp); \
569+
__stats->cnt++; \
570+
__stats->nsecs += sched_clock() - __start; \
571+
u64_stats_update_end(&__stats->syncp); \
572572
} else { \
573-
ret = dfunc(ctx, (prog)->insnsi, (prog)->bpf_func); \
573+
__ret = dfunc(ctx, (prog)->insnsi, (prog)->bpf_func); \
574574
} \
575-
ret; })
575+
__ret; })
576576

577577
#define BPF_PROG_RUN(prog, ctx) \
578578
__BPF_PROG_RUN(prog, ctx, bpf_dispatcher_nop_func)

0 commit comments

Comments
 (0)