[SCSI] drivers/scsi: Use ARRAY_SIZE macro
Use ARRAY_SIZE macro instead of sizeof(x)/sizeof(x[0]) and remove duplicates of the macro. Signed-off-by: Tobias Klauser <tklauser@nuerscht.ch> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
This commit is contained in:
committed by
James Bottomley
parent
9dc399de08
commit
6391a11375
@@ -5492,7 +5492,7 @@ static int __init osst_setup (char *str)
|
||||
char *stp;
|
||||
|
||||
stp = get_options(str, ARRAY_SIZE(ints), ints);
|
||||
|
||||
|
||||
if (ints[0] > 0) {
|
||||
for (i = 0; i < ints[0] && i < ARRAY_SIZE(parms); i++)
|
||||
*parms[i].val = ints[i + 1];
|
||||
@@ -5507,7 +5507,7 @@ static int __init osst_setup (char *str)
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (i >= sizeof(parms) / sizeof(struct osst_dev_parm))
|
||||
if (i >= ARRAY_SIZE(parms))
|
||||
printk(KERN_INFO "osst :I: Illegal parameter in '%s'\n",
|
||||
stp);
|
||||
stp = strchr(stp, ',');
|
||||
|
Reference in New Issue
Block a user