diff options
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')) |