Commit d884596f authored by David Woodhouse's avatar David Woodhouse Committed by Al Viro

[PATCH] Minor cosmetic cleanups to the code moved into auditfilter.c

Signed-off-by: default avatarDavid Woodhouse <dwmw2@infradead.org>
parent fe7752ba
...@@ -69,7 +69,7 @@ static inline int audit_copy_rule(struct audit_rule *d, struct audit_rule *s) ...@@ -69,7 +69,7 @@ static inline int audit_copy_rule(struct audit_rule *d, struct audit_rule *s)
/* Check to see if two rules are identical. It is called from /* Check to see if two rules are identical. It is called from
* audit_add_rule during AUDIT_ADD and * audit_add_rule during AUDIT_ADD and
* audit_del_rule during AUDIT_DEL. */ * audit_del_rule during AUDIT_DEL. */
static inline int audit_compare_rule(struct audit_rule *a, struct audit_rule *b) static int audit_compare_rule(struct audit_rule *a, struct audit_rule *b)
{ {
int i; int i;
...@@ -107,19 +107,18 @@ static inline int audit_add_rule(struct audit_rule *rule, ...@@ -107,19 +107,18 @@ static inline int audit_add_rule(struct audit_rule *rule,
/* Do not use the _rcu iterator here, since this is the only /* Do not use the _rcu iterator here, since this is the only
* addition routine. */ * addition routine. */
list_for_each_entry(entry, list, list) { list_for_each_entry(entry, list, list) {
if (!audit_compare_rule(rule, &entry->rule)) { if (!audit_compare_rule(rule, &entry->rule))
return -EEXIST; return -EEXIST;
}
} }
for (i = 0; i < rule->field_count; i++) { for (i = 0; i < rule->field_count; i++) {
if (rule->fields[i] & AUDIT_UNUSED_BITS) if (rule->fields[i] & AUDIT_UNUSED_BITS)
return -EINVAL; return -EINVAL;
if ( rule->fields[i] & AUDIT_NEGATE ) if ( rule->fields[i] & AUDIT_NEGATE)
rule->fields[i] |= AUDIT_NOT_EQUAL; rule->fields[i] |= AUDIT_NOT_EQUAL;
else if ( (rule->fields[i] & AUDIT_OPERATORS) == 0 ) else if ( (rule->fields[i] & AUDIT_OPERATORS) == 0 )
rule->fields[i] |= AUDIT_EQUAL; rule->fields[i] |= AUDIT_EQUAL;
rule->fields[i] &= (~AUDIT_NEGATE); rule->fields[i] &= ~AUDIT_NEGATE;
} }
if (!(entry = kmalloc(sizeof(*entry), GFP_KERNEL))) if (!(entry = kmalloc(sizeof(*entry), GFP_KERNEL)))
...@@ -374,5 +373,3 @@ int audit_filter_type(int type) ...@@ -374,5 +373,3 @@ int audit_filter_type(int type)
rcu_read_unlock(); rcu_read_unlock();
return result; return result;
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment