Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tools/power/cpupower: fix compilation with STATIC=true

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>
Cc: <stable@vger.kernel.org>
Signed-off-by: Shuah Khan (Samsung OSG) <shuah@kernel.org>

authored by

Konstantin Khlebnikov and committed by
Shuah Khan
9de9aa45 65102238

+6 -6
+1 -1
tools/power/cpupower/bench/Makefile
··· 9 9 ifeq ($(strip $(STATIC)),true) 10 10 LIBS = -L../ -L$(OUTPUT) -lm 11 11 OBJS = $(OUTPUT)main.o $(OUTPUT)parse.o $(OUTPUT)system.o $(OUTPUT)benchmark.o \ 12 - $(OUTPUT)../lib/cpufreq.o $(OUTPUT)../lib/sysfs.o 12 + $(OUTPUT)../lib/cpufreq.o $(OUTPUT)../lib/cpupower.o 13 13 else 14 14 LIBS = -L../ -L$(OUTPUT) -lm -lcpupower 15 15 OBJS = $(OUTPUT)main.o $(OUTPUT)parse.o $(OUTPUT)system.o $(OUTPUT)benchmark.o
+1 -1
tools/power/cpupower/lib/cpufreq.c
··· 28 28 29 29 snprintf(path, sizeof(path), PATH_TO_CPU "cpu%u/cpufreq/%s", 30 30 cpu, fname); 31 - return sysfs_read_file(path, buf, buflen); 31 + return cpupower_read_sysfs(path, buf, buflen); 32 32 } 33 33 34 34 /* helper function to write a new value to a /sys file */
+1 -1
tools/power/cpupower/lib/cpuidle.c
··· 319 319 320 320 snprintf(path, sizeof(path), PATH_TO_CPU "cpuidle/%s", fname); 321 321 322 - return sysfs_read_file(path, buf, buflen); 322 + return cpupower_read_sysfs(path, buf, buflen); 323 323 } 324 324 325 325
+2 -2
tools/power/cpupower/lib/cpupower.c
··· 15 15 #include "cpupower.h" 16 16 #include "cpupower_intern.h" 17 17 18 - unsigned int sysfs_read_file(const char *path, char *buf, size_t buflen) 18 + unsigned int cpupower_read_sysfs(const char *path, char *buf, size_t buflen) 19 19 { 20 20 int fd; 21 21 ssize_t numread; ··· 95 95 96 96 snprintf(path, sizeof(path), PATH_TO_CPU "cpu%u/topology/%s", 97 97 cpu, fname); 98 - if (sysfs_read_file(path, linebuf, MAX_LINE_LEN) == 0) 98 + if (cpupower_read_sysfs(path, linebuf, MAX_LINE_LEN) == 0) 99 99 return -1; 100 100 *result = strtol(linebuf, &endp, 0); 101 101 if (endp == linebuf || errno == ERANGE)
+1 -1
tools/power/cpupower/lib/cpupower_intern.h
··· 3 3 #define MAX_LINE_LEN 4096 4 4 #define SYSFS_PATH_MAX 255 5 5 6 - unsigned int sysfs_read_file(const char *path, char *buf, size_t buflen); 6 + unsigned int cpupower_read_sysfs(const char *path, char *buf, size_t buflen);