Skip to content

Commit c75ea02

Browse files
arndbjrjohansen
authored andcommitted
apparmor: avoid -Wempty-body warning
Building with 'make W=1' shows a warning for an empty macro: security/apparmor/label.c: In function '__label_update': security/apparmor/label.c:2096:59: error: suggest braces around empty body in an 'else' statement [-Werror=empty-body] 2096 | AA_BUG(labels_ns(label) != labels_ns(new)); Change the macro definition to use no_printk(), which improves format string checking and avoids the warning. Signed-off-by: Arnd Bergmann <[email protected]> Signed-off-by: John Johansen <[email protected]>
1 parent dc15561 commit c75ea02

File tree

1 file changed

+1
-1
lines changed
  • security/apparmor/include

1 file changed

+1
-1
lines changed

security/apparmor/include/lib.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
#define AA_BUG_FMT(X, fmt, args...) \
3737
WARN((X), "AppArmor WARN %s: (" #X "): " fmt, __func__, ##args)
3838
#else
39-
#define AA_BUG_FMT(X, fmt, args...)
39+
#define AA_BUG_FMT(X, fmt, args...) no_printk(fmt, ##args)
4040
#endif
4141

4242
#define AA_ERROR(fmt, args...) \

0 commit comments

Comments
 (0)