]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
audit: audit_tree_match can be boolean
authorYaowei Bai <bywxiaobai@163.com>
Tue, 29 Sep 2015 14:15:41 +0000 (22:15 +0800)
committerPaul Moore <pmoore@redhat.com>
Tue, 29 Sep 2015 18:39:18 +0000 (14:39 -0400)
This patch makes audit_tree_match return bool to improve readability
due to this particular function only using either one or zero as its
return value.

No functional change.

Signed-off-by: Yaowei Bai <bywxiaobai@163.com>
[PM: tweaked the subject line]
Signed-off-by: Paul Moore <pmoore@redhat.com>
kernel/audit.h
kernel/audit_tree.c

index 24ec861456673f299a1e1d8d272ca5b75c338bc9..e47d6ac46b45d3341cef9ea14aa19a054123604f 100644 (file)
@@ -298,7 +298,7 @@ extern int audit_exe_compare(struct task_struct *tsk, struct audit_fsnotify_mark
 #ifdef CONFIG_AUDIT_TREE
 extern struct audit_chunk *audit_tree_lookup(const struct inode *);
 extern void audit_put_chunk(struct audit_chunk *);
-extern int audit_tree_match(struct audit_chunk *, struct audit_tree *);
+extern bool audit_tree_match(struct audit_chunk *, struct audit_tree *);
 extern int audit_make_tree(struct audit_krule *, char *, u32);
 extern int audit_add_tree_rule(struct audit_krule *);
 extern int audit_remove_tree_rule(struct audit_krule *);
index f417225068089c23f55a3ca9ab9024e9b3166b8e..9acfd9feea861bff2245965044037e66a0b3ba80 100644 (file)
@@ -196,13 +196,13 @@ struct audit_chunk *audit_tree_lookup(const struct inode *inode)
        return NULL;
 }
 
-int audit_tree_match(struct audit_chunk *chunk, struct audit_tree *tree)
+bool audit_tree_match(struct audit_chunk *chunk, struct audit_tree *tree)
 {
        int n;
        for (n = 0; n < chunk->count; n++)
                if (chunk->owners[n].owner == tree)
-                       return 1;
-       return 0;
+                       return true;
+       return false;
 }
 
 /* tagging and untagging inodes with trees */