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

    [PATCH] w1: Use ARRAY_SIZE macro when appropriate
    
    A patch to use ARRAY_SIZE macro already defined in kernel.h
    
    Signed-off-by: Ahmed S. Darwish <[EMAIL PROTECTED]>
    Acked-by: Evgeniy Polyakov <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 drivers/w1/slaves/w1_therm.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/w1/slaves/w1_therm.c b/drivers/w1/slaves/w1_therm.c
index b022fff..732db47 100644
--- a/drivers/w1/slaves/w1_therm.c
+++ b/drivers/w1/slaves/w1_therm.c
@@ -141,7 +141,7 @@ static inline int w1_convert_temp(u8 rom[9], u8 fid)
 {
        int i;
 
-       for (i=0; i<sizeof(w1_therm_families)/sizeof(w1_therm_families[0]); ++i)
+       for (i = 0; i < ARRAY_SIZE(w1_therm_families); ++i)
                if (w1_therm_families[i].f->fid == fid)
                        return w1_therm_families[i].convert(rom);
 
@@ -238,7 +238,7 @@ static int __init w1_therm_init(void)
 {
        int err, i;
 
-       for (i=0; i<sizeof(w1_therm_families)/sizeof(w1_therm_families[0]); 
++i) {
+       for (i = 0; i < ARRAY_SIZE(w1_therm_families); ++i) {
                err = w1_register_family(w1_therm_families[i].f);
                if (err)
                        w1_therm_families[i].broken = 1;
@@ -251,7 +251,7 @@ static void __exit w1_therm_fini(void)
 {
        int i;
 
-       for (i=0; i<sizeof(w1_therm_families)/sizeof(w1_therm_families[0]); ++i)
+       for (i = 0; i < ARRAY_SIZE(w1_therm_families); ++i)
                if (!w1_therm_families[i].broken)
                        w1_unregister_family(w1_therm_families[i].f);
 }
-
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