Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=79a81aef769f3a188988ad16032ccfc445cfaa13
Commit:     79a81aef769f3a188988ad16032ccfc445cfaa13
Parent:     8b5925fd5461c9f1ac77ede48945ca1945202ddb
Author:     Ahmed S. Darwish <[EMAIL PROTECTED]>
AuthorDate: Mon Feb 12 00:52:09 2007 -0800
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Mon Feb 12 09:48:29 2007 -0800

    [PATCH] reiserfs: Use ARRAY_SIZE macro when appropriate
    
    Use ARRAY_SIZE macro already defined in kernel.h
    
    Signed-off-by: Ahmed S. Darwish <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 fs/reiserfs/do_balan.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/fs/reiserfs/do_balan.c b/fs/reiserfs/do_balan.c
index fba304e..f85c5cf 100644
--- a/fs/reiserfs/do_balan.c
+++ b/fs/reiserfs/do_balan.c
@@ -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]))
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to