X-Git-Url: http://git.cascardo.eti.br/?a=blobdiff_plain;f=drivers%2Fscsi%2Fscsi_sysfs.c;h=931a7d9542038138537a5b76a98fa27217a95d63;hb=dd5700ea98ad0b375a72525ce7d7edddf15b2693;hp=ce5224c92edae64061dd7c336d588838132a2e57;hpb=0ced14fbda44bf9c4977f1b01ae1077b944b94ab;p=cascardo%2Flinux.git diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c index ce5224c92eda..931a7d954203 100644 --- a/drivers/scsi/scsi_sysfs.c +++ b/drivers/scsi/scsi_sysfs.c @@ -247,11 +247,11 @@ show_shost_active_mode(struct device *dev, static DEVICE_ATTR(active_mode, S_IRUGO | S_IWUSR, show_shost_active_mode, NULL); -static int check_reset_type(char *str) +static int check_reset_type(const char *str) { - if (strncmp(str, "adapter", 10) == 0) + if (sysfs_streq(str, "adapter")) return SCSI_ADAPTER_RESET; - else if (strncmp(str, "firmware", 10) == 0) + else if (sysfs_streq(str, "firmware")) return SCSI_FIRMWARE_RESET; else return 0; @@ -264,12 +264,9 @@ store_host_reset(struct device *dev, struct device_attribute *attr, struct Scsi_Host *shost = class_to_shost(dev); struct scsi_host_template *sht = shost->hostt; int ret = -EINVAL; - char str[10]; int type; - sscanf(buf, "%s", str); - type = check_reset_type(str); - + type = check_reset_type(buf); if (!type) goto exit_store_host_reset;