From: Andrew Morton <[email protected]> Subject: security/apparmor/apparmorfs.c: conditionally compile get_loaddata_common_ref() Date: Wed Jun 3 01:30:46 PM PDT 2026
Some config did this: security/apparmor/apparmorfs.c:177:28: warning: 'get_loaddata_common_ref' defined but not used [-Wunused-function] 177 | static struct aa_loaddata *get_loaddata_common_ref(struct aa_common_ref *ref) get_loaddata_common_ref() is only used if CONFIG_SECURITY_APPARMOR_EXPORT_BINARY=y. (Or of course move the function into that block if maintainers perfer) Cc: John Johansen <[email protected]> Cc: Paul Moore <[email protected]> Cc: James Morris <[email protected]> Cc: "Serge E. Hallyn" <[email protected]> Signed-off-by: Andrew Morton <[email protected]> --- security/apparmor/apparmorfs.c | 2 ++ 1 file changed, 2 insertions(+) --- a/security/apparmor/apparmorfs.c~security-apparmor-apparmorfsc-conditionally-compile-get_loaddata_common_ref +++ a/security/apparmor/apparmorfs.c @@ -174,6 +174,7 @@ static struct aa_proxy *get_proxy_common return NULL; } +#ifdef CONFIG_SECURITY_APPARMOR_EXPORT_BINARY static struct aa_loaddata *get_loaddata_common_ref(struct aa_common_ref *ref) { if (ref) @@ -181,6 +182,7 @@ static struct aa_loaddata *get_loaddata_ count)); return NULL; } +#endif static void aa_put_common_ref(struct aa_common_ref *ref) { _
