]> err.no Git - linux-2.6/commitdiff
V4L/DVB (5942): Usb/vp7045.c: ARRAY_SIZE()
authorAndi Drebes <lists-receive@programmierforen.de>
Mon, 30 Jul 2007 14:49:51 +0000 (11:49 -0300)
committerMauro Carvalho Chehab <mchehab@infradead.org>
Wed, 10 Oct 2007 01:03:34 +0000 (22:03 -0300)
This patch replaces an array size calculation done using sizeof
with an invocation of the ARRAY_SIZE macro.

Tested by compilation on an i386 box using "allyesconfig".
Diffed against Linus' git-tree.

Signed-off-by: Andi Drebes <lists-receive@programmierforen.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
drivers/media/dvb/dvb-usb/vp7045.c

index 69a46b3607a2a1d63e42dc2daacb2983896039c8..5bbd2d5192f0a4130cd47a28808b3ff94c707040 100644 (file)
@@ -159,7 +159,7 @@ static int vp7045_rc_query(struct dvb_usb_device *d, u32 *event, int *state)
                return 0;
        }
 
-       for (i = 0; i < sizeof(vp7045_rc_keys)/sizeof(struct dvb_usb_rc_key); i++)
+       for (i = 0; i < ARRAY_SIZE(vp7045_rc_keys); i++)
                if (vp7045_rc_keys[i].data == key) {
                        *state = REMOTE_KEY_PRESSED;
                        *event = vp7045_rc_keys[i].event;