From e8c96f8c29d89af0c13dc2819a9a00575846ca18 Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Fri, 24 Mar 2006 03:15:34 -0800 Subject: [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 Cc: David Howells Cc: Dave Kleikamp Acked-by: Trond Myklebust Cc: Neil Brown Cc: Chris Mason Cc: Jeff Mahoney Cc: Christoph Hellwig Cc: Nathan Scott Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- fs/udf/super.c | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) (limited to 'fs/udf/super.c') diff --git a/fs/udf/super.c b/fs/udf/super.c index 9303c50c5d5..0d555616c93 100644 --- a/fs/udf/super.c +++ b/fs/udf/super.c @@ -660,8 +660,7 @@ udf_find_anchor(struct super_block *sb) * lastblock * however, if the disc isn't closed, it could be 512 */ - for (i=0; (!lastblock && ib_data)->tagLocation); udf_release_data(bh); } - + if (ident == TAG_IDENT_AVDP) { if (location == last[i] - UDF_SB_SESSION(sb)) @@ -753,8 +752,7 @@ udf_find_anchor(struct super_block *sb) } } - for (i=0; imainVolDescSeqExt.extLength ); main_e = main_e >> sb->s_blocksize_bits; main_e += main_s; - + /* Locate the reserve sequence */ reserve_s = le32_to_cpu(anchor->reserveVolDescSeqExt.extLocation); reserve_e = le32_to_cpu(anchor->reserveVolDescSeqExt.extLength); @@ -1344,12 +1341,10 @@ udf_load_partition(struct super_block *sb, kernel_lb_addr *fileset) } } - if (i == sizeof(UDF_SB_ANCHOR(sb))/sizeof(int)) - { + if (i == ARRAY_SIZE(UDF_SB_ANCHOR(sb))) { udf_debug("No Anchor block found\n"); return 1; - } - else + } else udf_debug("Using anchor in block %d\n", UDF_SB_ANCHOR(sb)[i]); for (i=0; i