Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

lsm: make keys for static branch static

The key use for static-branches are not refrenced by name outside
of the security/security.c file, so make them static. This stops
the sparse warnings about "Should it be static?" such as:

security/security.c: note: in included file:
./include/linux/lsm_hook_defs.h:29:1: warning: symbol
'security_hook_active_binder_set_context_mgr_0' was not declared.
Should it be static?
./include/linux/lsm_hook_defs.h:29:1: warning: symbol
'security_hook_active_binder_set_context_mgr_1' was not declared.
Should it be static?
...

Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
[PM: trimmed sparse output for line-length, readability]
Signed-off-by: Paul Moore <paul@paul-moore.com>

authored by

Ben Dooks and committed by
Paul Moore
47271106 5547598e

+1 -1
+1 -1
security/security.c
··· 115 115 #define DEFINE_LSM_STATIC_CALL(NUM, NAME, RET, ...) \ 116 116 DEFINE_STATIC_CALL_NULL(LSM_STATIC_CALL(NAME, NUM), \ 117 117 *((RET(*)(__VA_ARGS__))NULL)); \ 118 - DEFINE_STATIC_KEY_FALSE(SECURITY_HOOK_ACTIVE_KEY(NAME, NUM)); 118 + static DEFINE_STATIC_KEY_FALSE(SECURITY_HOOK_ACTIVE_KEY(NAME, NUM)); 119 119 120 120 #define LSM_HOOK(RET, DEFAULT, NAME, ...) \ 121 121 LSM_DEFINE_UNROLL(DEFINE_LSM_STATIC_CALL, NAME, RET, __VA_ARGS__)