linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] tools/power/cpupower: fix compilation with STATIC=true
@ 2018-10-16  8:56 Konstantin Khlebnikov
  2018-10-16 11:39 ` Thomas Renninger
  0 siblings, 1 reply; 3+ messages in thread
From: Konstantin Khlebnikov @ 2018-10-16  8:56 UTC (permalink / raw)
  To: Shuah Khan, linux-kernel, Thomas Renninger, linux-pm

Rename duplicate sysfs_read_file into cpupower_read_sysfs and fix linking.

Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
---
 tools/power/cpupower/bench/Makefile        |    2 +-
 tools/power/cpupower/lib/cpufreq.c         |    2 +-
 tools/power/cpupower/lib/cpuidle.c         |    2 +-
 tools/power/cpupower/lib/cpupower.c        |    4 ++--
 tools/power/cpupower/lib/cpupower_intern.h |    2 +-
 5 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/tools/power/cpupower/bench/Makefile b/tools/power/cpupower/bench/Makefile
index d79ab161cc75..f68b4bc55273 100644
--- a/tools/power/cpupower/bench/Makefile
+++ b/tools/power/cpupower/bench/Makefile
@@ -9,7 +9,7 @@ endif
 ifeq ($(strip $(STATIC)),true)
 LIBS = -L../ -L$(OUTPUT) -lm
 OBJS = $(OUTPUT)main.o $(OUTPUT)parse.o $(OUTPUT)system.o $(OUTPUT)benchmark.o \
-       $(OUTPUT)../lib/cpufreq.o $(OUTPUT)../lib/sysfs.o
+       $(OUTPUT)../lib/cpufreq.o $(OUTPUT)../lib/cpupower.o
 else
 LIBS = -L../ -L$(OUTPUT) -lm -lcpupower
 OBJS = $(OUTPUT)main.o $(OUTPUT)parse.o $(OUTPUT)system.o $(OUTPUT)benchmark.o
diff --git a/tools/power/cpupower/lib/cpufreq.c b/tools/power/cpupower/lib/cpufreq.c
index 1b993fe1ce23..0c0f3e3f0d80 100644
--- a/tools/power/cpupower/lib/cpufreq.c
+++ b/tools/power/cpupower/lib/cpufreq.c
@@ -28,7 +28,7 @@ static unsigned int sysfs_cpufreq_read_file(unsigned int cpu, const char *fname,
 
 	snprintf(path, sizeof(path), PATH_TO_CPU "cpu%u/cpufreq/%s",
 			 cpu, fname);
-	return sysfs_read_file(path, buf, buflen);
+	return cpupower_read_sysfs(path, buf, buflen);
 }
 
 /* helper function to write a new value to a /sys file */
diff --git a/tools/power/cpupower/lib/cpuidle.c b/tools/power/cpupower/lib/cpuidle.c
index 9bd4c7655fdb..852d25462388 100644
--- a/tools/power/cpupower/lib/cpuidle.c
+++ b/tools/power/cpupower/lib/cpuidle.c
@@ -319,7 +319,7 @@ static unsigned int sysfs_cpuidle_read_file(const char *fname, char *buf,
 
 	snprintf(path, sizeof(path), PATH_TO_CPU "cpuidle/%s", fname);
 
-	return sysfs_read_file(path, buf, buflen);
+	return cpupower_read_sysfs(path, buf, buflen);
 }
 
 
diff --git a/tools/power/cpupower/lib/cpupower.c b/tools/power/cpupower/lib/cpupower.c
index 9c395ec924de..9711d628b0f4 100644
--- a/tools/power/cpupower/lib/cpupower.c
+++ b/tools/power/cpupower/lib/cpupower.c
@@ -15,7 +15,7 @@
 #include "cpupower.h"
 #include "cpupower_intern.h"
 
-unsigned int sysfs_read_file(const char *path, char *buf, size_t buflen)
+unsigned int cpupower_read_sysfs(const char *path, char *buf, size_t buflen)
 {
 	int fd;
 	ssize_t numread;
@@ -95,7 +95,7 @@ static int sysfs_topology_read_file(unsigned int cpu, const char *fname, int *re
 
 	snprintf(path, sizeof(path), PATH_TO_CPU "cpu%u/topology/%s",
 			 cpu, fname);
-	if (sysfs_read_file(path, linebuf, MAX_LINE_LEN) == 0)
+	if (cpupower_read_sysfs(path, linebuf, MAX_LINE_LEN) == 0)
 		return -1;
 	*result = strtol(linebuf, &endp, 0);
 	if (endp == linebuf || errno == ERANGE)
diff --git a/tools/power/cpupower/lib/cpupower_intern.h b/tools/power/cpupower/lib/cpupower_intern.h
index 92affdfbe417..4887c76d23f8 100644
--- a/tools/power/cpupower/lib/cpupower_intern.h
+++ b/tools/power/cpupower/lib/cpupower_intern.h
@@ -3,4 +3,4 @@
 #define MAX_LINE_LEN 4096
 #define SYSFS_PATH_MAX 255
 
-unsigned int sysfs_read_file(const char *path, char *buf, size_t buflen);
+unsigned int cpupower_read_sysfs(const char *path, char *buf, size_t buflen);


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] tools/power/cpupower: fix compilation with STATIC=true
  2018-10-16  8:56 [PATCH] tools/power/cpupower: fix compilation with STATIC=true Konstantin Khlebnikov
@ 2018-10-16 11:39 ` Thomas Renninger
  2018-10-16 14:28   ` Shuah Khan
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Renninger @ 2018-10-16 11:39 UTC (permalink / raw)
  To: Konstantin Khlebnikov; +Cc: Shuah Khan, linux-kernel, linux-pm, rafael

On Tuesday, October 16, 2018 10:56:26 AM CEST Konstantin Khlebnikov wrote:
> Rename duplicate sysfs_read_file into cpupower_read_sysfs and fix linking.
> 
> Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>

Acked-by: Thomas Renninger <trenn@suse.de>

Thanks!

> -       $(OUTPUT)../lib/cpufreq.o $(OUTPUT)../lib/sysfs.o
> +       $(OUTPUT)../lib/cpufreq.o $(OUTPUT)../lib/cpupower.o

I also looked at this and would only have fixed half of it (overseeing above
old leftover from cpupower lib introduction).
I guess, this patch from Konstantin is better and the correct solution.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] tools/power/cpupower: fix compilation with STATIC=true
  2018-10-16 11:39 ` Thomas Renninger
@ 2018-10-16 14:28   ` Shuah Khan
  0 siblings, 0 replies; 3+ messages in thread
From: Shuah Khan @ 2018-10-16 14:28 UTC (permalink / raw)
  To: Thomas Renninger, Konstantin Khlebnikov
  Cc: linux-kernel, linux-pm, rafael, Shuah Khan

On 10/16/2018 05:39 AM, Thomas Renninger wrote:
> On Tuesday, October 16, 2018 10:56:26 AM CEST Konstantin Khlebnikov wrote:
>> Rename duplicate sysfs_read_file into cpupower_read_sysfs and fix linking.
>>
>> Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
> 
> Acked-by: Thomas Renninger <trenn@suse.de>
> 
> Thanks!
> 
>> -       $(OUTPUT)../lib/cpufreq.o $(OUTPUT)../lib/sysfs.o
>> +       $(OUTPUT)../lib/cpufreq.o $(OUTPUT)../lib/cpupower.o
> 
> I also looked at this and would only have fixed half of it (overseeing above
> old leftover from cpupower lib introduction).
> I guess, this patch from Konstantin is better and the correct solution.
> 

Thank you both. I will get this into 4.20-rc1 or rc2 depending on how timing
works.

I think this applies to stable as well.

thanks,
-- Shuah

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-10-16 14:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-16  8:56 [PATCH] tools/power/cpupower: fix compilation with STATIC=true Konstantin Khlebnikov
2018-10-16 11:39 ` Thomas Renninger
2018-10-16 14:28   ` Shuah Khan

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).