]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
[PATCH] reiserfs: Use ARRAY_SIZE macro when appropriate
authorAhmed S. Darwish <darwish.07@gmail.com>
Mon, 12 Feb 2007 08:52:09 +0000 (00:52 -0800)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Mon, 12 Feb 2007 17:48:29 +0000 (09:48 -0800)
Use ARRAY_SIZE macro already defined in kernel.h

Signed-off-by: Ahmed S. Darwish <darwish.07@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/reiserfs/do_balan.c

index fba304e64de81d51805d52434b152a6fc8aed50b..f85c5cf4934ce3a3869e15c8f5cb9d432a05461c 100644 (file)
@@ -19,6 +19,7 @@
 #include <linux/time.h>
 #include <linux/reiserfs_fs.h>
 #include <linux/buffer_head.h>
+#include <linux/kernel.h>
 
 #ifdef CONFIG_REISERFS_CHECK
 
@@ -1756,7 +1757,7 @@ static void store_thrown(struct tree_balance *tb, struct buffer_head *bh)
        if (buffer_dirty(bh))
                reiserfs_warning(tb->tb_sb,
                                 "store_thrown deals with dirty buffer");
-       for (i = 0; i < sizeof(tb->thrown) / sizeof(tb->thrown[0]); i++)
+       for (i = 0; i < ARRAY_SIZE(tb->thrown); i++)
                if (!tb->thrown[i]) {
                        tb->thrown[i] = bh;
                        get_bh(bh);     /* free_thrown puts this */
@@ -1769,7 +1770,7 @@ static void free_thrown(struct tree_balance *tb)
 {
        int i;
        b_blocknr_t blocknr;
-       for (i = 0; i < sizeof(tb->thrown) / sizeof(tb->thrown[0]); i++) {
+       for (i = 0; i < ARRAY_SIZE(tb->thrown); i++) {
                if (tb->thrown[i]) {
                        blocknr = tb->thrown[i]->b_blocknr;
                        if (buffer_dirty(tb->thrown[i]))