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/scsi_transport_spi.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/scsi_transport_spi.c')
-rw-r--r-- | drivers/scsi/scsi_transport_spi.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/scsi/scsi_transport_spi.c b/drivers/scsi/scsi_transport_spi.c index 780aaedcbce9..5829f97a2068 100644 --- a/drivers/scsi/scsi_transport_spi.c +++ b/drivers/scsi/scsi_transport_spi.c | |||
@@ -146,7 +146,7 @@ static inline const char *spi_signal_to_string(enum spi_signal_type type) | |||
146 | { | 146 | { |
147 | int i; | 147 | int i; |
148 | 148 | ||
149 | for (i = 0; i < sizeof(signal_types)/sizeof(signal_types[0]); i++) { | 149 | for (i = 0; i < ARRAY_SIZE(signal_types); i++) { |
150 | if (type == signal_types[i].value) | 150 | if (type == signal_types[i].value) |
151 | return signal_types[i].name; | 151 | return signal_types[i].name; |
152 | } | 152 | } |
@@ -156,7 +156,7 @@ static inline enum spi_signal_type spi_signal_to_value(const char *name) | |||
156 | { | 156 | { |
157 | int i, len; | 157 | int i, len; |
158 | 158 | ||
159 | for (i = 0; i < sizeof(signal_types)/sizeof(signal_types[0]); i++) { | 159 | for (i = 0; i < ARRAY_SIZE(signal_types); i++) { |
160 | len = strlen(signal_types[i].name); | 160 | len = strlen(signal_types[i].name); |
161 | if (strncmp(name, signal_types[i].name, len) == 0 && | 161 | if (strncmp(name, signal_types[i].name, len) == 0 && |
162 | (name[len] == '\n' || name[len] == '\0')) | 162 | (name[len] == '\n' || name[len] == '\0')) |