[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:
Tobias Klauser
2006-06-08 22:23:48 -07:00
committed by James Bottomley
parent 9dc399de08
commit 6391a11375
47 changed files with 167 additions and 200 deletions

View File

@@ -131,7 +131,7 @@ static const char *raid_state_name(enum raid_state state)
int i;
char *name = NULL;
for (i = 0; i < sizeof(raid_states)/sizeof(raid_states[0]); i++) {
for (i = 0; i < ARRAY_SIZE(raid_states); i++) {
if (raid_states[i].value == state) {
name = raid_states[i].name;
break;
@@ -161,7 +161,7 @@ static const char *raid_level_name(enum raid_level level)
int i;
char *name = NULL;
for (i = 0; i < sizeof(raid_levels)/sizeof(raid_levels[0]); i++) {
for (i = 0; i < ARRAY_SIZE(raid_levels); i++) {
if (raid_levels[i].value == level) {
name = raid_levels[i].name;
break;