Linux ACPI
 help / color / mirror / Atom feed
From: Adam Belay <abelay@novell.com>
To: Brown@vger.kernel.org, Len <len.brown@intel.com>
Cc: linux acpi <linux-acpi@vger.kernel.org>,
	linux-pm@lists.linux-foundation.org,
	Venki Pallipadi <venkatesh.pallipadi@intel.com>,
	Shaohua Li <shaohua.li@intel.com>
Subject: [PATCH 1/6] CPUIDLE: fix 'current_governor' sysfs entry
Date: Tue, 21 Aug 2007 18:24:40 -0400	[thread overview]
Message-ID: <1187735080.7199.48.camel@callisto.site> (raw)

This patch allows the "current_governor" sysfs entry to properly handle
input terminated with '\n'.

Please Apply,
Adam

Change Summary:
 sysfs.c |    9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
---

diff -urN a/drivers/cpuidle/sysfs.c b/drivers/cpuidle/sysfs.c
--- a/drivers/cpuidle/sysfs.c	2007-08-13 00:02:10.000000000 -0400
+++ b/drivers/cpuidle/sysfs.c	2007-08-03 20:59:47.000000000 -0400
@@ -80,16 +80,13 @@
 
 	memcpy(gov_name, buf, len);
 	gov_name[len] = '\0';
-
-	len = strlen(gov_name);
-
-	if (len && gov_name[len - 1] == '\n')
-		gov_name[len - 1] = '\0';
+	if (gov_name[len - 1] == '\n')
+		gov_name[--len] = '\0';
 
 	mutex_lock(&cpuidle_lock);
 
 	list_for_each_entry(gov, &cpuidle_governors, governor_list) {
-		if (strlen(gov->name) == len && !strcmp(gov->name, buf)) {
+		if (strlen(gov->name) == len && !strcmp(gov->name, gov_name)) {
 			ret = cpuidle_switch_governor(gov);
 			break;
 		}



                 reply	other threads:[~2007-08-21 22:31 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1187735080.7199.48.camel@callisto.site \
    --to=abelay@novell.com \
    --cc=Brown@vger.kernel.org \
    --cc=len.brown@intel.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-pm@lists.linux-foundation.org \
    --cc=shaohua.li@intel.com \
    --cc=venkatesh.pallipadi@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox