ata: Don't require newlines for link_power_management_policy
authorMatthew Garrett <mjg@redhat.com>
Tue, 17 Nov 2009 16:09:03 +0000 (11:09 -0500)
committerJeff Garzik <jgarzik@redhat.com>
Thu, 3 Dec 2009 07:46:35 +0000 (02:46 -0500)
sysfs attributes shouldn't require newlines. Make it possible to set the
link power management policy without a trailing newline.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
drivers/ata/libata-scsi.c

index b4ee28dec5218b19db9682e729458e4d6b30d2bb..512a3ee8caf699a711053486c41346cf7a16a9d3 100644 (file)
@@ -154,8 +154,7 @@ static ssize_t ata_scsi_lpm_put(struct device *dev,
         */
        for (i = 1; i < ARRAY_SIZE(link_pm_policy); i++) {
                const int len = strlen(link_pm_policy[i].name);
-               if (strncmp(link_pm_policy[i].name, buf, len) == 0 &&
-                  buf[len] == '\n') {
+               if (strncmp(link_pm_policy[i].name, buf, len) == 0) {
                        policy = link_pm_policy[i].value;
                        break;
                }