[PATCH] selinux: ARRAY_SIZE cleanups
authorNicolas Kaiser <nikai@nikai.net>
Fri, 6 Jan 2006 08:11:22 +0000 (00:11 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Fri, 6 Jan 2006 16:33:29 +0000 (08:33 -0800)
Use ARRAY_SIZE macro instead of sizeof(x)/sizeof(x[0]).

Signed-off-by: Nicolas Kaiser <nikai@nikai.net>
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
Acked-by: James Morris <jmorris@namei.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
security/selinux/selinuxfs.c

index 0e1352a555c867baa67d136a49d946f8e9f5fc73..e59da6398d44508ca902c7dad417ddb0cdba888a 100644 (file)
@@ -376,7 +376,7 @@ static ssize_t selinux_transaction_write(struct file *file, const char __user *b
        char *data;
        ssize_t rv;
 
-       if (ino >= sizeof(write_op)/sizeof(write_op[0]) || !write_op[ino])
+       if (ino >= ARRAY_SIZE(write_op) || !write_op[ino])
                return -EINVAL;
 
        data = simple_transaction_get(file, buf, size);
@@ -1161,7 +1161,7 @@ static int sel_make_avc_files(struct dentry *dir)
 #endif
        };
 
-       for (i = 0; i < sizeof (files) / sizeof (files[0]); i++) {
+       for (i = 0; i < ARRAY_SIZE(files); i++) {
                struct inode *inode;
                struct dentry *dentry;