diff options
author | David Woodhouse <dwmw2@infradead.org> | 2005-12-16 05:48:28 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2006-03-20 14:08:54 -0500 |
commit | d884596f44ef5a0bcd8a66405dc04902aeaa6fc7 (patch) | |
tree | 25371c8c71a4319d839e73dc86131a8355d36681 | |
parent | fe7752bab26a9ac0651b695ad4f55659761f68f7 (diff) |
[PATCH] Minor cosmetic cleanups to the code moved into auditfilter.c
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
-rw-r--r-- | kernel/auditfilter.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/kernel/auditfilter.c b/kernel/auditfilter.c index 7f347c360876..a3a32752f973 100644 --- a/kernel/auditfilter.c +++ b/kernel/auditfilter.c | |||
@@ -69,7 +69,7 @@ static inline int audit_copy_rule(struct audit_rule *d, struct audit_rule *s) | |||
69 | /* Check to see if two rules are identical. It is called from | 69 | /* Check to see if two rules are identical. It is called from |
70 | * audit_add_rule during AUDIT_ADD and | 70 | * audit_add_rule during AUDIT_ADD and |
71 | * audit_del_rule during AUDIT_DEL. */ | 71 | * audit_del_rule during AUDIT_DEL. */ |
72 | static inline int audit_compare_rule(struct audit_rule *a, struct audit_rule *b) | 72 | static int audit_compare_rule(struct audit_rule *a, struct audit_rule *b) |
73 | { | 73 | { |
74 | int i; | 74 | int i; |
75 | 75 | ||
@@ -107,19 +107,18 @@ static inline int audit_add_rule(struct audit_rule *rule, | |||
107 | /* Do not use the _rcu iterator here, since this is the only | 107 | /* Do not use the _rcu iterator here, since this is the only |
108 | * addition routine. */ | 108 | * addition routine. */ |
109 | list_for_each_entry(entry, list, list) { | 109 | list_for_each_entry(entry, list, list) { |
110 | if (!audit_compare_rule(rule, &entry->rule)) { | 110 | if (!audit_compare_rule(rule, &entry->rule)) |
111 | return -EEXIST; | 111 | return -EEXIST; |
112 | } | ||
113 | } | 112 | } |
114 | 113 | ||
115 | for (i = 0; i < rule->field_count; i++) { | 114 | for (i = 0; i < rule->field_count; i++) { |
116 | if (rule->fields[i] & AUDIT_UNUSED_BITS) | 115 | if (rule->fields[i] & AUDIT_UNUSED_BITS) |
117 | return -EINVAL; | 116 | return -EINVAL; |
118 | if ( rule->fields[i] & AUDIT_NEGATE ) | 117 | if ( rule->fields[i] & AUDIT_NEGATE) |
119 | rule->fields[i] |= AUDIT_NOT_EQUAL; | 118 | rule->fields[i] |= AUDIT_NOT_EQUAL; |
120 | else if ( (rule->fields[i] & AUDIT_OPERATORS) == 0 ) | 119 | else if ( (rule->fields[i] & AUDIT_OPERATORS) == 0 ) |
121 | rule->fields[i] |= AUDIT_EQUAL; | 120 | rule->fields[i] |= AUDIT_EQUAL; |
122 | rule->fields[i] &= (~AUDIT_NEGATE); | 121 | rule->fields[i] &= ~AUDIT_NEGATE; |
123 | } | 122 | } |
124 | 123 | ||
125 | if (!(entry = kmalloc(sizeof(*entry), GFP_KERNEL))) | 124 | if (!(entry = kmalloc(sizeof(*entry), GFP_KERNEL))) |
@@ -374,5 +373,3 @@ unlock_and_return: | |||
374 | rcu_read_unlock(); | 373 | rcu_read_unlock(); |
375 | return result; | 374 | return result; |
376 | } | 375 | } |
377 | |||
378 | |||