diff options
author | Tobias Klauser <tklauser@nuerscht.ch> | 2006-06-09 01:23:48 -0400 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.il.steeleye.com> | 2006-06-10 11:45:30 -0400 |
commit | 6391a11375de5e2bb1eb8481e54619761dc65d9f (patch) | |
tree | 956aae1d278a3f731b2e6148ff40a69aa7957ea8 /drivers/scsi/raid_class.c | |
parent | 9dc399de0840a478adb71278becf598d3ab3aacc (diff) |
[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>
Diffstat (limited to 'drivers/scsi/raid_class.c')
-rw-r--r-- | drivers/scsi/raid_class.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/scsi/raid_class.c b/drivers/scsi/raid_class.c index 50c398aab557..327b33a57b0a 100644 --- a/drivers/scsi/raid_class.c +++ b/drivers/scsi/raid_class.c | |||
@@ -131,7 +131,7 @@ static const char *raid_state_name(enum raid_state state) | |||
131 | int i; | 131 | int i; |
132 | char *name = NULL; | 132 | char *name = NULL; |
133 | 133 | ||
134 | for (i = 0; i < sizeof(raid_states)/sizeof(raid_states[0]); i++) { | 134 | for (i = 0; i < ARRAY_SIZE(raid_states); i++) { |
135 | if (raid_states[i].value == state) { | 135 | if (raid_states[i].value == state) { |
136 | name = raid_states[i].name; | 136 | name = raid_states[i].name; |
137 | break; | 137 | break; |
@@ -161,7 +161,7 @@ static const char *raid_level_name(enum raid_level level) | |||
161 | int i; | 161 | int i; |
162 | char *name = NULL; | 162 | char *name = NULL; |
163 | 163 | ||
164 | for (i = 0; i < sizeof(raid_levels)/sizeof(raid_levels[0]); i++) { | 164 | for (i = 0; i < ARRAY_SIZE(raid_levels); i++) { |
165 | if (raid_levels[i].value == level) { | 165 | if (raid_levels[i].value == level) { |
166 | name = raid_levels[i].name; | 166 | name = raid_levels[i].name; |
167 | break; | 167 | break; |