Skip to content

Commit

Permalink
apparmor: avoid -Wempty-body warning
Browse files Browse the repository at this point in the history
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 <arnd@arndb.de>
Signed-off-by: John Johansen <john.johansen@canonical.com>
  • Loading branch information
arndb authored and John Johansen committed Nov 3, 2021
1 parent dc15561 commit c75ea02
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion security/apparmor/include/lib.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
#define AA_BUG_FMT(X, fmt, args...) \
WARN((X), "AppArmor WARN %s: (" #X "): " fmt, __func__, ##args)
#else
#define AA_BUG_FMT(X, fmt, args...)
#define AA_BUG_FMT(X, fmt, args...) no_printk(fmt, ##args)
#endif

#define AA_ERROR(fmt, args...) \
Expand Down

0 comments on commit c75ea02

Please sign in to comment.