[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 <tklauser@nuerscht.ch> Cc: David Howells <dhowells@redhat.com> Cc: Dave Kleikamp <shaggy@austin.ibm.com> Acked-by: Trond Myklebust <trond.myklebust@fys.uio.no> Cc: Neil Brown <neilb@cse.unsw.edu.au> Cc: Chris Mason <mason@suse.com> Cc: Jeff Mahoney <jeffm@suse.com> Cc: Christoph Hellwig <hch@lst.de> Cc: Nathan Scott <nathans@sgi.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
committed by
Linus Torvalds
parent
b5029622ac
commit
e8c96f8c29
@ -992,7 +992,7 @@ nfsd4_decode_compound(struct nfsd4_compoundargs *argp)
|
||||
if (argp->opcnt > 100)
|
||||
goto xdr_error;
|
||||
|
||||
if (argp->opcnt > sizeof(argp->iops)/sizeof(argp->iops[0])) {
|
||||
if (argp->opcnt > ARRAY_SIZE(argp->iops)) {
|
||||
argp->ops = kmalloc(argp->opcnt * sizeof(*argp->ops), GFP_KERNEL);
|
||||
if (!argp->ops) {
|
||||
argp->ops = argp->iops;
|
||||
|
Reference in New Issue
Block a user