Skip to content

Commit

Permalink
[media] it913x-fe: use ARRAY_SIZE() as a cleanup
Browse files Browse the repository at this point in the history
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>
Cc: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Dan Carpenter authored and Mauro Carvalho Chehab committed Aug 15, 2012
1 parent 3bfb410 commit 5359805
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/media/dvb-frontends/it913x-fe.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 5359805

Please sign in to comment.