* [PATCH] ata: Don't require newlines for link_power_management_policy
@ 2009-11-17 16:09 Matthew Garrett
2009-11-19 21:30 ` Jeff Garzik
0 siblings, 1 reply; 2+ messages in thread
From: Matthew Garrett @ 2009-11-17 16:09 UTC (permalink / raw)
To: linux-ide; +Cc: jgarzik, Matthew Garrett
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;
break;
}
--
1.6.5.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ata: Don't require newlines for link_power_management_policy
2009-11-17 16:09 [PATCH] ata: Don't require newlines for link_power_management_policy Matthew Garrett
@ 2009-11-19 21:30 ` Jeff Garzik
0 siblings, 0 replies; 2+ messages in thread
From: Jeff Garzik @ 2009-11-19 21:30 UTC (permalink / raw)
To: Matthew Garrett; +Cc: linux-ide
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-11-19 21:30 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-17 16:09 [PATCH] ata: Don't require newlines for link_power_management_policy Matthew Garrett
2009-11-19 21:30 ` Jeff Garzik
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).