提交 6e20a64a 编写于 作者: N Nicolas Kaiser 提交者: Linus Torvalds

[PATCH] selinux: ARRAY_SIZE cleanups

Use ARRAY_SIZE macro instead of sizeof(x)/sizeof(x[0]).
Signed-off-by: NNicolas Kaiser <nikai@nikai.net>
Signed-off-by: NStephen Smalley <sds@tycho.nsa.gov>
Acked-by: NJames Morris <jmorris@namei.org>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 b09eb1c0
...@@ -376,7 +376,7 @@ static ssize_t selinux_transaction_write(struct file *file, const char __user *b ...@@ -376,7 +376,7 @@ static ssize_t selinux_transaction_write(struct file *file, const char __user *b
char *data; char *data;
ssize_t rv; 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; return -EINVAL;
data = simple_transaction_get(file, buf, size); data = simple_transaction_get(file, buf, size);
...@@ -1161,7 +1161,7 @@ static int sel_make_avc_files(struct dentry *dir) ...@@ -1161,7 +1161,7 @@ static int sel_make_avc_files(struct dentry *dir)
#endif #endif
}; };
for (i = 0; i < sizeof (files) / sizeof (files[0]); i++) { for (i = 0; i < ARRAY_SIZE(files); i++) {
struct inode *inode; struct inode *inode;
struct dentry *dentry; struct dentry *dentry;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册