[media] it913x-fe: use ARRAY_SIZE() as a cleanup
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 14 Aug 2012 05:51:20 +0000 (02:51 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Wed, 15 Aug 2012 21:47:10 +0000 (18:47 -0300)
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>
drivers/media/dvb-frontends/it913x-fe.c

index 708cbf197913669d84eafe50e0f18fcee2f6ef4e..6e1c6eb340b7ead632f4629cee4a60999c2ccf3c 100644 (file)
@@ -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;