diff options
author | Matthieu Baerts <matthieu.baerts@tessares.net> | 2021-03-26 13:50:23 +0300 |
---|---|---|
committer | Peter Zijlstra <peterz@infradead.org> | 2021-04-09 14:22:12 +0300 |
commit | 7d95f22798ecea513f37b792b39fec4bcf20fec3 (patch) | |
tree | ac43b255bed5e2d902a08013bdb0e2040115bbea /kernel/sched | |
parent | a51a327f3bcdcb1a37ed9325ad07e1456cd4d426 (diff) | |
download | linux-7d95f22798ecea513f37b792b39fec4bcf20fec3.tar.xz |
static_call: Fix unused variable warn w/o MODULE
Here is the warning converted as error and reported by GCC:
kernel/static_call.c: In function ‘__static_call_update’:
kernel/static_call.c:153:18: error: unused variable ‘mod’ [-Werror=unused-variable]
153 | struct module *mod = site_mod->mod;
| ^~~
cc1: all warnings being treated as errors
make[1]: *** [scripts/Makefile.build:271: kernel/static_call.o] Error 1
This is simply because since recently, we no longer use 'mod' variable
elsewhere if MODULE is unset.
When using 'make tinyconfig' to generate the default kconfig, MODULE is
unset.
There are different ways to fix this warning. Here I tried to minimised
the number of modified lines and not add more #ifdef. We could also move
the declaration of the 'mod' variable inside the if-statement or
directly use site_mod->mod.
Fixes: 698bacefe993 ("static_call: Align static_call_is_init() patching condition")
Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20210326105023.2058860-1-matthieu.baerts@tessares.net
Diffstat (limited to 'kernel/sched')
0 files changed, 0 insertions, 0 deletions