提交 9d0094de 编写于 作者: A Ahmed S. Darwish 提交者: Linus Torvalds

[PATCH] w1: Use ARRAY_SIZE macro when appropriate

A patch to use ARRAY_SIZE macro already defined in kernel.h
Signed-off-by: NAhmed S. Darwish <darwish.07@gmail.com>
Acked-by: NEvgeniy Polyakov <johnpol@2ka.mipt.ru>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 3f050447
......@@ -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);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册