aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/scsi_sysfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/scsi_sysfs.c')
-rw-r--r--drivers/scsi/scsi_sysfs.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c
index a6fde52946d6..5ec7a4fb0145 100644
--- a/drivers/scsi/scsi_sysfs.c
+++ b/drivers/scsi/scsi_sysfs.c
@@ -39,7 +39,7 @@ const char *scsi_device_state_name(enum scsi_device_state state)
39 int i; 39 int i;
40 char *name = NULL; 40 char *name = NULL;
41 41
42 for (i = 0; i < sizeof(sdev_states)/sizeof(sdev_states[0]); i++) { 42 for (i = 0; i < ARRAY_SIZE(sdev_states); i++) {
43 if (sdev_states[i].value == state) { 43 if (sdev_states[i].value == state) {
44 name = sdev_states[i].name; 44 name = sdev_states[i].name;
45 break; 45 break;
@@ -65,7 +65,7 @@ const char *scsi_host_state_name(enum scsi_host_state state)
65 int i; 65 int i;
66 char *name = NULL; 66 char *name = NULL;
67 67
68 for (i = 0; i < sizeof(shost_states)/sizeof(shost_states[0]); i++) { 68 for (i = 0; i < ARRAY_SIZE(shost_states); i++) {
69 if (shost_states[i].value == state) { 69 if (shost_states[i].value == state) {
70 name = shost_states[i].name; 70 name = shost_states[i].name;
71 break; 71 break;
@@ -160,7 +160,7 @@ store_shost_state(struct class_device *class_dev, const char *buf, size_t count)
160 struct Scsi_Host *shost = class_to_shost(class_dev); 160 struct Scsi_Host *shost = class_to_shost(class_dev);
161 enum scsi_host_state state = 0; 161 enum scsi_host_state state = 0;
162 162
163 for (i = 0; i < sizeof(shost_states)/sizeof(shost_states[0]); i++) { 163 for (i = 0; i < ARRAY_SIZE(shost_states); i++) {
164 const int len = strlen(shost_states[i].name); 164 const int len = strlen(shost_states[i].name);
165 if (strncmp(shost_states[i].name, buf, len) == 0 && 165 if (strncmp(shost_states[i].name, buf, len) == 0 &&
166 buf[len] == '\n') { 166 buf[len] == '\n') {
@@ -466,7 +466,7 @@ store_state_field(struct device *dev, struct device_attribute *attr, const char
466 struct scsi_device *sdev = to_scsi_device(dev); 466 struct scsi_device *sdev = to_scsi_device(dev);
467 enum scsi_device_state state = 0; 467 enum scsi_device_state state = 0;
468 468
469 for (i = 0; i < sizeof(sdev_states)/sizeof(sdev_states[0]); i++) { 469 for (i = 0; i < ARRAY_SIZE(sdev_states); i++) {
470 const int len = strlen(sdev_states[i].name); 470 const int len = strlen(sdev_states[i].name);
471 if (strncmp(sdev_states[i].name, buf, len) == 0 && 471 if (strncmp(sdev_states[i].name, buf, len) == 0 &&
472 buf[len] == '\n') { 472 buf[len] == '\n') {