* [PATCH 1/6] CPUIDLE: fix 'current_governor' sysfs entry
@ 2007-08-21 22:24 Adam Belay
0 siblings, 0 replies; only message in thread
From: Adam Belay @ 2007-08-21 22:24 UTC (permalink / raw)
To: Brown, Len; +Cc: linux acpi, linux-pm, Venki Pallipadi, Shaohua Li
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;
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2007-08-21 22:31 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-21 22:24 [PATCH 1/6] CPUIDLE: fix 'current_governor' sysfs entry Adam Belay
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox