cpupowerutils: bench - Fix cpu online check
PATCH v2 1/1 cpupowerutils: bench - Fix cpu online check
cpupower_is_cpu_online was incorrectly checking for 0. This patch fixes this by checking for 1 when the cpu is online.
---
v2: Commit message rephrased.
--- tools/power/cpupower/bench/system.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/power/cpupower/bench/system.c +1 -1
@@ -61,7 +61,7 @@ int set_cpufreq_governor(char *governor, unsigned int cpu)dprintf ("set %s as cpufreq governor\n" , governor); -if (cpupower_is_cpu_online (cpu) !=0 ) { +if (cpupower_is_cpu_online (cpu) !=1 ) {perror ("cpufreq_cpu_exists" );fprintf (stderr,"error: cpu %u does not exist\n" , cpu);return -1 ;
Signature · 1 line
2.9.3
Hi,
Can you please have a look at this also?
Thanks and Regards,
Abhishek Goel
System Engineer
IBM India Pvt. Ltd.
Quoted 23 lines · Abhishek Goel
cpupower_is_cpu_onlinewas incorrectly checking for 0. This patch fixes this by checking for 1 when the cpu is online.Signed-off-by Abhishek Goel <[email protected]>---
v2: Commit message rephrased.--- tools/power/cpupower/bench/system.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tools/power/cpupower/bench/system.c +1
-1@@ -61,7 +61,7 @@ int set_cpufreq_governor(char *governor, unsigned int cpu)dprintf ("set %s as cpufreq governor\n" , governor); -if (cpupower_is_cpu_online (cpu) !=0 ) { +if (cpupower_is_cpu_online (cpu) !=1 ) {perror ("cpufreq_cpu_exists" );fprintf (stderr,"error: cpu %u does not exist\n" , cpu);return -1 ;
Quoted 9 lines · Abhishek
Hi,
Can you please have a look at this also?
Thanks and Regards,
Abhishek Goel
System Engineer
IBM India Pvt. Ltd.
Same comment on top posting.
Quoted 17 lines · Abhishek Goel
Quoted 16 lines
cpupower_is_cpu_onlinewas incorrectly checking for 0. This patch fixes this by checking for 1 when the cpu is online.Signed-off-by Abhishek Goel <[email protected]>---
v2: Commit message rephrased.
---
tools/power/cpupower/bench/system.c| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)tools/power/cpupower/bench/system.c +0
-0@@ -61,7 +61,7 @@ int set_cpufreq_governor(char *governor, unsigned int cpu)
Quoted 8 lines
tools/power/cpupower/bench/system.c int set_cpufreq_governor(char *governor, unsigned int cpu) · line 67
Quoted 7 lines
tools/power/cpupower/bench/system.c +1
-1dprintf("set %s as cpufreq governor\n", governor); - if (cpupower_is_cpu_online(cpu) != 0) { + if (cpupower_is_cpu_online(cpu) != 1) { perror("cpufreq_cpu_exists"); fprintf(stderr, "error: cpu %u does not exist\n", cpu); return -1;
Ths patch looks good to me. I still need it in my Inbox. Please send it to me directly.
thanks,
-- Shuah
Quoted 16 lines · Abhishek Goel
cpupower_is_cpu_onlinewas incorrectly checking for 0. This patch fixes this by checking for 1 when the cpu is online.Signed-off-by Abhishek Goel <[email protected]>---
v2: Commit message rephrased.--- tools/power/cpupower/bench/system.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tools/power/cpupower/bench/system.c +0
-0
tools/power/cpupower/bench/system.c int set_cpufreq_governor(char *governor, unsigned int cpu) · line 67
Quoted 8 lines
tools/power/cpupower/bench/system.c +1
-1@@ -61,7 +61,7 @@ int set_cpufreq_governor(char *governor, unsigned int cpu)dprintf ("set %s as cpufreq governor\n" , governor); -if (cpupower_is_cpu_online (cpu) !=0 ) { +if (cpupower_is_cpu_online (cpu) !=1 ) {perror ("cpufreq_cpu_exists" );fprintf (stderr,"error: cpu %u does not exist\n" , cpu);return -1 ;
Thanks. I will queue this up for 4.15-rc2
-- Shuah