* [patch] [media] it913x-fe: use ARRAY_SIZE() as a cleanup
@ 2012-08-14 6:51 ` Dan Carpenter
0 siblings, 0 replies; 2+ messages in thread
From: Dan Carpenter @ 2012-08-14 6:51 UTC (permalink / raw)
To: Mauro Carvalho Chehab
Cc: Malcolm Priestley, Hans Verkuil, linux-media, kernel-janitors
This code looks suspicious, but it turns out that "nv" is an array of u8
so sizeof() is the same as ARRAY_SIZE(). Using ARRAY_SIZE() is more
readable though.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/drivers/media/dvb/frontends/it913x-fe.c b/drivers/media/dvb/frontends/it913x-fe.c
index 708cbf1..6e1c6eb 100644
--- a/drivers/media/dvb/frontends/it913x-fe.c
+++ b/drivers/media/dvb/frontends/it913x-fe.c
@@ -199,7 +199,7 @@ static int it913x_init_tuner(struct it913x_fe_state *state)
if (reg < 0)
return -ENODEV;
- else if (reg < sizeof(nv))
+ else if (reg < ARRAY_SIZE(nv))
nv_val = nv[reg];
else
nv_val = 2;
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [patch] [media] it913x-fe: use ARRAY_SIZE() as a cleanup
@ 2012-08-14 6:51 ` Dan Carpenter
0 siblings, 0 replies; 2+ messages in thread
From: Dan Carpenter @ 2012-08-14 6:51 UTC (permalink / raw)
To: Mauro Carvalho Chehab
Cc: Malcolm Priestley, Hans Verkuil, linux-media, kernel-janitors
This code looks suspicious, but it turns out that "nv" is an array of u8
so sizeof() is the same as ARRAY_SIZE(). Using ARRAY_SIZE() is more
readable though.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/drivers/media/dvb/frontends/it913x-fe.c b/drivers/media/dvb/frontends/it913x-fe.c
index 708cbf1..6e1c6eb 100644
--- a/drivers/media/dvb/frontends/it913x-fe.c
+++ b/drivers/media/dvb/frontends/it913x-fe.c
@@ -199,7 +199,7 @@ static int it913x_init_tuner(struct it913x_fe_state *state)
if (reg < 0)
return -ENODEV;
- else if (reg < sizeof(nv))
+ else if (reg < ARRAY_SIZE(nv))
nv_val = nv[reg];
else
nv_val = 2;
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-08-14 6:51 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-14 6:51 [patch] [media] it913x-fe: use ARRAY_SIZE() as a cleanup Dan Carpenter
2012-08-14 6:51 ` Dan Carpenter
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.