Skip to contentSkip to conversation

drivers/media/dvb/dvb-usb/vp7045.c: ARRAY_SIZE()

PATCH In review Andi Drebes 2 participants 2 messages Jul 26, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drivers/media/dvb/dvb-usb/vp7045.c: ARRAY_SIZE()

This patch replaces an array size calculation done using sizeof with an invocation of the ARRAY_SIZE macro.

Please CC me for any comments.

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

---

drivers/media/dvb/dvb-usb/vp7045.c +1 -1
index 69a46b3..5bbd2d5 100644
@@ -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;

_______________________________________________
REMINDER: this mailing list moved to vger.kernel.org and current one will be discontinued soon. To resubscribe, send email to [email protected] with
&quot;subscribe kernel-janitors&quot; in message body and follow instructions.

Kernel-janitors mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/kernel-janitors

#1 lore raw
Quoted 2 lines · On Thu, 26 Jul 2007 16:56:16 +0200 Andi Drebes wrote:

This patch replaces an array size calculation done using sizeof with an invocation of the ARRAY_SIZE macro.

Patches look good to me.

However, the real reason that I'm replying is to ask you and others to begin using (only) the new KJ mailing list:
[email protected]

I'd like to ask the Linux Foundation to stop accepting email on this list soon.

Quoted 8 lines

_______________________________________________
REMINDER: this mailing list moved to vger.kernel.org and current one will be discontinued soon. To resubscribe, send email to [email protected] with
&quot;subscribe kernel-janitors&quot; in message body and follow instructions.

Kernel-janitors mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/kernel-janitors

---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***
_______________________________________________
REMINDER: this mailing list moved to vger.kernel.org and current one will be discontinued soon. To resubscribe, send email to [email protected] with
&quot;subscribe kernel-janitors&quot; in message body and follow instructions.

Kernel-janitors mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/kernel-janitors