Commit 79a81aef authored by Ahmed S. Darwish's avatar Ahmed S. Darwish Committed by Linus Torvalds

[PATCH] reiserfs: Use ARRAY_SIZE macro when appropriate

Use ARRAY_SIZE macro already defined in kernel.h
Signed-off-by: default avatarAhmed S. Darwish <darwish.07@gmail.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 8b5925fd
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include <linux/time.h> #include <linux/time.h>
#include <linux/reiserfs_fs.h> #include <linux/reiserfs_fs.h>
#include <linux/buffer_head.h> #include <linux/buffer_head.h>
#include <linux/kernel.h>
#ifdef CONFIG_REISERFS_CHECK #ifdef CONFIG_REISERFS_CHECK
...@@ -1756,7 +1757,7 @@ static void store_thrown(struct tree_balance *tb, struct buffer_head *bh) ...@@ -1756,7 +1757,7 @@ static void store_thrown(struct tree_balance *tb, struct buffer_head *bh)
if (buffer_dirty(bh)) if (buffer_dirty(bh))
reiserfs_warning(tb->tb_sb, reiserfs_warning(tb->tb_sb,
"store_thrown deals with dirty buffer"); "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]) { if (!tb->thrown[i]) {
tb->thrown[i] = bh; tb->thrown[i] = bh;
get_bh(bh); /* free_thrown puts this */ get_bh(bh); /* free_thrown puts this */
...@@ -1769,7 +1770,7 @@ static void free_thrown(struct tree_balance *tb) ...@@ -1769,7 +1770,7 @@ static void free_thrown(struct tree_balance *tb)
{ {
int i; int i;
b_blocknr_t blocknr; 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]) { if (tb->thrown[i]) {
blocknr = tb->thrown[i]->b_blocknr; blocknr = tb->thrown[i]->b_blocknr;
if (buffer_dirty(tb->thrown[i])) if (buffer_dirty(tb->thrown[i]))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment