[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
@@ -133,13 +133,11 @@ static struct nand_flash_dev nand_flash_ids[] = {
|
||||
{ 0,}
|
||||
};
|
||||
|
||||
#define SIZE(a) (sizeof(a)/sizeof((a)[0]))
|
||||
|
||||
static struct nand_flash_dev *
|
||||
nand_find_id(unsigned char id) {
|
||||
int i;
|
||||
|
||||
for (i = 0; i < SIZE(nand_flash_ids); i++)
|
||||
for (i = 0; i < ARRAY_SIZE(nand_flash_ids); i++)
|
||||
if (nand_flash_ids[i].model_id == id)
|
||||
return &(nand_flash_ids[i]);
|
||||
return NULL;
|
||||
|
Reference in New Issue
Block a user