提交 6a744637 编写于 作者: M Matthew Garrett 提交者: Jeff Garzik

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: NMatthew Garrett <mjg@redhat.com>
Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
上级 4192be64
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册