[PATCH] fs: Use ARRAY_SIZE macro

Use ARRAY_SIZE macro instead of sizeof(x)/sizeof(x[0]) and remove a
duplicate of ARRAY_SIZE.  Some trailing whitespaces are also deleted.

Signed-off-by: Tobias Klauser <[email protected]>
Cc: David Howells <[email protected]>
Cc: Dave Kleikamp <[email protected]>
Acked-by: Trond Myklebust <[email protected]>
Cc: Neil Brown <[email protected]>
Cc: Chris Mason <[email protected]>
Cc: Jeff Mahoney <[email protected]>
Cc: Christoph Hellwig <[email protected]>
Cc: Nathan Scott <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
Tobias Klauser 2006-03-24 03:15:34 -08:00 • committed by Linus Torvalds
commit e8c96f8c29
23 changed files with 40 additions and 51 deletions

View file

@ -101,7 +101,7 @@ asmlinkage sys_nfsservctl(int cmd, struct nfsctl_arg __user *arg, void __user *r
if (version != NFSCTL_VERSION)
return -EINVAL;
if (cmd < 0 || cmd >= sizeof(map)/sizeof(map[0]) || !map[cmd].name)
if (cmd < 0 || cmd >= ARRAY_SIZE(map) || !map[cmd].name)
return -EINVAL;
file = do_open(map[cmd].name, map[cmd].rsize ? O_RDWR : O_WRONLY);