[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
@@ -4239,15 +4239,12 @@ qla1280_get_token(char *str)
|
||||
{
|
||||
char *sep;
|
||||
long ret = -1;
|
||||
int i, len;
|
||||
|
||||
len = sizeof(setup_token)/sizeof(struct setup_tokens);
|
||||
int i;
|
||||
|
||||
sep = strchr(str, ':');
|
||||
|
||||
if (sep) {
|
||||
for (i = 0; i < len; i++){
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(setup_token); i++) {
|
||||
if (!strncmp(setup_token[i].token, str, (sep - str))) {
|
||||
ret = setup_token[i].val;
|
||||
break;
|
||||
|
Reference in New Issue
Block a user