[PATCH] USB: Use ARRAY_SIZE macro
Use ARRAY_SIZE macro instead of sizeof(x)/sizeof(x[0]) and remove duplicates of ARRAY_SIZE. Some trailing whitespaces are also removed. Patch is compile-tested on i386. Signed-off-by: Tobias Klauser <tklauser@nuerscht.ch> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
f3d34ed48c
commit
52950ed40d
@@ -2093,7 +2093,7 @@ aiptek_probe(struct usb_interface *intf, const struct usb_device_id *id)
|
||||
/* Programming the tablet macro keys needs to be done with a for loop
|
||||
* as the keycodes are discontiguous.
|
||||
*/
|
||||
for (i = 0; i < sizeof(macroKeyEvents) / sizeof(macroKeyEvents[0]); ++i)
|
||||
for (i = 0; i < ARRAY_SIZE(macroKeyEvents); ++i)
|
||||
set_bit(macroKeyEvents[i], inputdev->keybit);
|
||||
|
||||
/*
|
||||
@@ -2135,7 +2135,7 @@ aiptek_probe(struct usb_interface *intf, const struct usb_device_id *id)
|
||||
* not an error :-)
|
||||
*/
|
||||
|
||||
for (i = 0; i < sizeof(speeds) / sizeof(speeds[0]); ++i) {
|
||||
for (i = 0; i < ARRAY_SIZE(speeds); ++i) {
|
||||
aiptek->curSetting.programmableDelay = speeds[i];
|
||||
(void)aiptek_program_tablet(aiptek);
|
||||
if (aiptek->inputdev->absmax[ABS_X] > 0) {
|
||||
|
Reference in New Issue
Block a user