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.

apparmor: use the condition in AA_BUG_FMT even with debug disabled

This follows the established practice and fixes a build failure for me:
security/apparmor/file.c: In function ‘__file_sock_perm’:
security/apparmor/file.c:544:24: error: unused variable ‘sock’ [-Werror=unused-variable]
544 | struct socket *sock = (struct socket *) file->private_data;
| ^~~~

Signed-off-by: Mateusz Guzik <mjguzik@gmail.com>
Signed-off-by: John Johansen <john.johansen@canonical.com>

authored by

Mateusz Guzik and committed by
John Johansen
67e370aa aabbe6f9

+5 -1
+5 -1
security/apparmor/include/lib.h
··· 60 60 #define AA_BUG_FMT(X, fmt, args...) \ 61 61 WARN((X), "AppArmor WARN %s: (" #X "): " fmt, __func__, ##args) 62 62 #else 63 - #define AA_BUG_FMT(X, fmt, args...) no_printk(fmt, ##args) 63 + #define AA_BUG_FMT(X, fmt, args...) \ 64 + do { \ 65 + BUILD_BUG_ON_INVALID(X); \ 66 + no_printk(fmt, ##args); \ 67 + } while (0) 64 68 #endif 65 69 66 70 int aa_parse_debug_params(const char *str);