Patchwork ata: Don't require newlines for link_power_management_policy

login
register
mail settings
Submitter Matthew Garrett
Date Nov. 17, 2009, 4:09 p.m.
Message ID <1258474143-3020-1-git-send-email-mjg@redhat.com>
Download mbox | patch
Permalink /patch/38654/
State Not Applicable
Delegated to: David Miller
Headers show

Comments

Matthew Garrett - Nov. 17, 2009, 4:09 p.m.
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>
---
 drivers/ata/libata-scsi.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
Jeff Garzik - Nov. 19, 2009, 9:30 p.m.
On 11/17/2009 11:09 AM, Matthew Garrett wrote:
> 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>
> ---
>   drivers/ata/libata-scsi.c |    3 +--
>   1 files changed, 1 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
> index b4ee28d..512a3ee 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;

applied


--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index b4ee28d..512a3ee 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;
 		}