Skip to contentSkip to conversation

ata: Don't require newlines for link_power_management_policy

PATCH Applied Matthew Garrett 2 participants 2 messages Nov 17, 2009 – Nov 19, 2009 libata

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 drivers/ata/libata-scsi.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
drivers/ata/libata-scsi.c +1 -2
index b4ee28d..512a3ee 100644
@@ -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;
 		}
Signature · 1 line
1.6.5.2
Applied
#1 lore raw
Quoted 13 lines · Matthew Garrett

sysfs attributes shouldn't require newlines. Make it possible to set the link power management policy without a trailing newline.

---
  drivers/ata/libata-scsi.c |    3 +--
  1 files changed, 1 insertions(+), 2 deletions(-)
drivers/ata/libata-scsi.c +0 -0
index b4ee28d..512a3ee 100644

drivers/ata/libata-scsi.c static ssize_t ata_scsi_lpm_put(struct device *dev, · line 158

Quoted 7 lines
drivers/ata/libata-scsi.c +1 -2
@@ -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;

applied