From: Matthew Garrett Date: Tue, 17 Nov 2009 16:09:03 +0000 (-0500) Subject: ata: Don't require newlines for link_power_management_policy X-Git-Tag: v2.6.33-rc1~380^2~43 X-Git-Url: http://bbs.cooldavid.org/git/?a=commitdiff_plain;h=6a74463798bde03f849d8d82d97e4f8e4cf160f3;p=net-next-2.6.git ata: Don't require newlines for link_power_management_policy 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 Signed-off-by: Jeff Garzik --- diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c index b4ee28dec52..512a3ee8caf 100644 --- a/drivers/ata/libata-scsi.c +++ b/drivers/ata/libata-scsi.c @@ -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; }