X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=drivers%2Fscsi%2Fscsi_sysfs.c;h=5ec7a4fb0145bfc83b488cdae27a1e2a16e9a81a;hb=6c763eb9ead86c612492b59287b36c0dcf7d09b1;hp=89055494dfee3f86a2b6ae3d7db82eab42c8cff9;hpb=1c2e02750b992703a8a18634e08b04353face243;p=powerpc.git diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c index 89055494df..5ec7a4fb01 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) int i; char *name = NULL; - for (i = 0; i < sizeof(sdev_states)/sizeof(sdev_states[0]); i++) { + for (i = 0; i < ARRAY_SIZE(sdev_states); i++) { if (sdev_states[i].value == state) { name = sdev_states[i].name; break; @@ -65,7 +65,7 @@ const char *scsi_host_state_name(enum scsi_host_state state) int i; char *name = NULL; - for (i = 0; i < sizeof(shost_states)/sizeof(shost_states[0]); i++) { + for (i = 0; i < ARRAY_SIZE(shost_states); i++) { if (shost_states[i].value == state) { name = shost_states[i].name; break; @@ -160,7 +160,7 @@ store_shost_state(struct class_device *class_dev, const char *buf, size_t count) struct Scsi_Host *shost = class_to_shost(class_dev); enum scsi_host_state state = 0; - for (i = 0; i < sizeof(shost_states)/sizeof(shost_states[0]); i++) { + for (i = 0; i < ARRAY_SIZE(shost_states); i++) { const int len = strlen(shost_states[i].name); if (strncmp(shost_states[i].name, buf, len) == 0 && buf[len] == '\n') { @@ -286,7 +286,7 @@ static int scsi_bus_suspend(struct device * dev, pm_message_t state) return err; if (sht->suspend) - err = sht->suspend(sdev); + err = sht->suspend(sdev, state); return err; } @@ -466,7 +466,7 @@ store_state_field(struct device *dev, struct device_attribute *attr, const char struct scsi_device *sdev = to_scsi_device(dev); enum scsi_device_state state = 0; - for (i = 0; i < sizeof(sdev_states)/sizeof(sdev_states[0]); i++) { + for (i = 0; i < ARRAY_SIZE(sdev_states); i++) { const int len = strlen(sdev_states[i].name); if (strncmp(sdev_states[i].name, buf, len) == 0 && buf[len] == '\n') {