Skip to content

Commit

Permalink
[PATCH] w1: Use ARRAY_SIZE macro when appropriate
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
a-darwish authored and Linus Torvalds committed Feb 12, 2007
1 parent 3f05044 commit 9d0094d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/w1/slaves/w1_therm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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;
Expand All @@ -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);
}
Expand Down

0 comments on commit 9d0094d

Please sign in to comment.