Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[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 <darwish.07@gmail.com>
Acked-by: Evgeniy Polyakov <johnpol@2ka.mipt.ru>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Ahmed S. Darwish and committed by
Linus Torvalds
9d0094de 3f050447

+3 -3
+3 -3
drivers/w1/slaves/w1_therm.c
··· 141 141 { 142 142 int i; 143 143 144 - for (i=0; i<sizeof(w1_therm_families)/sizeof(w1_therm_families[0]); ++i) 144 + for (i = 0; i < ARRAY_SIZE(w1_therm_families); ++i) 145 145 if (w1_therm_families[i].f->fid == fid) 146 146 return w1_therm_families[i].convert(rom); 147 147 ··· 238 238 { 239 239 int err, i; 240 240 241 - for (i=0; i<sizeof(w1_therm_families)/sizeof(w1_therm_families[0]); ++i) { 241 + for (i = 0; i < ARRAY_SIZE(w1_therm_families); ++i) { 242 242 err = w1_register_family(w1_therm_families[i].f); 243 243 if (err) 244 244 w1_therm_families[i].broken = 1; ··· 251 251 { 252 252 int i; 253 253 254 - for (i=0; i<sizeof(w1_therm_families)/sizeof(w1_therm_families[0]); ++i) 254 + for (i = 0; i < ARRAY_SIZE(w1_therm_families); ++i) 255 255 if (!w1_therm_families[i].broken) 256 256 w1_unregister_family(w1_therm_families[i].f); 257 257 }