Skip to content

Commit

Permalink
[PATCH] selinux: ARRAY_SIZE cleanups
Browse files Browse the repository at this point in the history
Use ARRAY_SIZE macro instead of sizeof(x)/sizeof(x[0]).

Signed-off-by: Nicolas Kaiser <[email protected]>
Signed-off-by: Stephen Smalley <[email protected]>
Acked-by: James Morris <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
nikai3d authored and Linus Torvalds committed Jan 6, 2006
1 parent b09eb1c commit 6e20a64
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions security/selinux/selinuxfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;

Expand Down

0 comments on commit 6e20a64

Please sign in to comment.