summaryrefslogtreecommitdiffstats
path: root/security/apparmor
diff options
context:
space:
mode:
authorJohn Johansen <john.johansen@canonical.com>2013-02-19 01:01:34 +0100
committerJohn Johansen <john.johansen@canonical.com>2013-04-28 09:35:29 +0200
commit50c5ecd5d8ffb0e549676b8fd9781e3b2fd751a0 (patch)
tree0d5101b4d3021569f4f50832180b417537c550b1 /security/apparmor
parentapparmor: Remove -W1 warnings (diff)
downloadlinux-50c5ecd5d8ffb0e549676b8fd9781e3b2fd751a0.tar.xz
linux-50c5ecd5d8ffb0e549676b8fd9781e3b2fd751a0.zip
apparmor: refactor profile mode macros
Signed-off-by: John Johansen <john.johansen@canonical.com> Acked-by: Steve Beattie <sbeattie@ubuntu.com>
Diffstat (limited to 'security/apparmor')
-rw-r--r--security/apparmor/include/policy.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/security/apparmor/include/policy.h b/security/apparmor/include/policy.h
index bda4569fdd83..95979c431e26 100644
--- a/security/apparmor/include/policy.h
+++ b/security/apparmor/include/policy.h
@@ -32,13 +32,13 @@
extern const char *const profile_mode_names[];
#define APPARMOR_NAMES_MAX_INDEX 3
-#define COMPLAIN_MODE(_profile) \
- ((aa_g_profile_mode == APPARMOR_COMPLAIN) || \
- ((_profile)->mode == APPARMOR_COMPLAIN))
+#define PROFILE_MODE(_profile, _mode) \
+ ((aa_g_profile_mode == (_mode)) || \
+ ((_profile)->mode == (_mode)))
-#define KILL_MODE(_profile) \
- ((aa_g_profile_mode == APPARMOR_KILL) || \
- ((_profile)->mode == APPARMOR_KILL))
+#define COMPLAIN_MODE(_profile) PROFILE_MODE((_profile), APPARMOR_COMPLAIN)
+
+#define KILL_MODE(_profile) PROFILE_MODE((_profile), APPARMOR_KILL)
#define PROFILE_IS_HAT(_profile) ((_profile)->flags & PFLAG_HAT)