aboutsummaryrefslogtreecommitdiffstats
path: root/fs/udf
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@nuerscht.ch>2006-03-24 06:15:34 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-03-24 10:33:19 -0500
commite8c96f8c29d89af0c13dc2819a9a00575846ca18 (patch)
treeb90ed0da4803df56a91be5979580e335af2d697c /fs/udf
parentb5029622ac86bb441dc5e641226fb1152fca02d7 (diff)
[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>
Diffstat (limited to 'fs/udf')
-rw-r--r--fs/udf/super.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/fs/udf/super.c b/fs/udf/super.c
index 9303c50c5d55..0d555616c939 100644
--- a/fs/udf/super.c
+++ b/fs/udf/super.c
@@ -660,8 +660,7 @@ udf_find_anchor(struct super_block *sb)
660 * lastblock 660 * lastblock
661 * however, if the disc isn't closed, it could be 512 */ 661 * however, if the disc isn't closed, it could be 512 */
662 662
663 for (i=0; (!lastblock && i<sizeof(last)/sizeof(int)); i++) 663 for (i = 0; !lastblock && i < ARRAY_SIZE(last); i++) {
664 {
665 if (last[i] < 0 || !(bh = sb_bread(sb, last[i]))) 664 if (last[i] < 0 || !(bh = sb_bread(sb, last[i])))
666 { 665 {
667 ident = location = 0; 666 ident = location = 0;
@@ -672,7 +671,7 @@ udf_find_anchor(struct super_block *sb)
672 location = le32_to_cpu(((tag *)bh->b_data)->tagLocation); 671 location = le32_to_cpu(((tag *)bh->b_data)->tagLocation);
673 udf_release_data(bh); 672 udf_release_data(bh);
674 } 673 }
675 674
676 if (ident == TAG_IDENT_AVDP) 675 if (ident == TAG_IDENT_AVDP)
677 { 676 {
678 if (location == last[i] - UDF_SB_SESSION(sb)) 677 if (location == last[i] - UDF_SB_SESSION(sb))
@@ -753,8 +752,7 @@ udf_find_anchor(struct super_block *sb)
753 } 752 }
754 } 753 }
755 754
756 for (i=0; i<sizeof(UDF_SB_ANCHOR(sb))/sizeof(int); i++) 755 for (i = 0; i < ARRAY_SIZE(UDF_SB_ANCHOR(sb)); i++) {
757 {
758 if (UDF_SB_ANCHOR(sb)[i]) 756 if (UDF_SB_ANCHOR(sb)[i])
759 { 757 {
760 if (!(bh = udf_read_tagged(sb, 758 if (!(bh = udf_read_tagged(sb,
@@ -1313,8 +1311,7 @@ udf_load_partition(struct super_block *sb, kernel_lb_addr *fileset)
1313 if (!sb) 1311 if (!sb)
1314 return 1; 1312 return 1;
1315 1313
1316 for (i=0; i<sizeof(UDF_SB_ANCHOR(sb))/sizeof(int); i++) 1314 for (i = 0; i < ARRAY_SIZE(UDF_SB_ANCHOR(sb)); i++) {
1317 {
1318 if (UDF_SB_ANCHOR(sb)[i] && (bh = udf_read_tagged(sb, 1315 if (UDF_SB_ANCHOR(sb)[i] && (bh = udf_read_tagged(sb,
1319 UDF_SB_ANCHOR(sb)[i], UDF_SB_ANCHOR(sb)[i], &ident))) 1316 UDF_SB_ANCHOR(sb)[i], UDF_SB_ANCHOR(sb)[i], &ident)))
1320 { 1317 {
@@ -1325,7 +1322,7 @@ udf_load_partition(struct super_block *sb, kernel_lb_addr *fileset)
1325 main_e = le32_to_cpu( anchor->mainVolDescSeqExt.extLength ); 1322 main_e = le32_to_cpu( anchor->mainVolDescSeqExt.extLength );
1326 main_e = main_e >> sb->s_blocksize_bits; 1323 main_e = main_e >> sb->s_blocksize_bits;
1327 main_e += main_s; 1324 main_e += main_s;
1328 1325
1329 /* Locate the reserve sequence */ 1326 /* Locate the reserve sequence */
1330 reserve_s = le32_to_cpu(anchor->reserveVolDescSeqExt.extLocation); 1327 reserve_s = le32_to_cpu(anchor->reserveVolDescSeqExt.extLocation);
1331 reserve_e = le32_to_cpu(anchor->reserveVolDescSeqExt.extLength); 1328 reserve_e = le32_to_cpu(anchor->reserveVolDescSeqExt.extLength);
@@ -1344,12 +1341,10 @@ udf_load_partition(struct super_block *sb, kernel_lb_addr *fileset)
1344 } 1341 }
1345 } 1342 }
1346 1343
1347 if (i == sizeof(UDF_SB_ANCHOR(sb))/sizeof(int)) 1344 if (i == ARRAY_SIZE(UDF_SB_ANCHOR(sb))) {
1348 {
1349 udf_debug("No Anchor block found\n"); 1345 udf_debug("No Anchor block found\n");
1350 return 1; 1346 return 1;
1351 } 1347 } else
1352 else
1353 udf_debug("Using anchor in block %d\n", UDF_SB_ANCHOR(sb)[i]); 1348 udf_debug("Using anchor in block %d\n", UDF_SB_ANCHOR(sb)[i]);
1354 1349
1355 for (i=0; i<UDF_SB_NUMPARTS(sb); i++) 1350 for (i=0; i<UDF_SB_NUMPARTS(sb); i++)