Commit 3b99dcd4 authored by Konstantin Khlebnikov's avatar Konstantin Khlebnikov Committed by Greg Kroah-Hartman

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

commit 9de9aa45 upstream.

Rename duplicate sysfs_read_file into cpupower_read_sysfs and fix linking.
Signed-off-by: default avatarKonstantin Khlebnikov <khlebnikov@yandex-team.ru>
Acked-by: default avatarThomas Renninger <trenn@suse.de>
Cc: <stable@vger.kernel.org>
Signed-off-by: default avatarShuah Khan (Samsung OSG) <shuah@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent a0b9ddf4
...@@ -9,7 +9,7 @@ endif ...@@ -9,7 +9,7 @@ endif
ifeq ($(strip $(STATIC)),true) ifeq ($(strip $(STATIC)),true)
LIBS = -L../ -L$(OUTPUT) -lm LIBS = -L../ -L$(OUTPUT) -lm
OBJS = $(OUTPUT)main.o $(OUTPUT)parse.o $(OUTPUT)system.o $(OUTPUT)benchmark.o \ 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 else
LIBS = -L../ -L$(OUTPUT) -lm -lcpupower LIBS = -L../ -L$(OUTPUT) -lm -lcpupower
OBJS = $(OUTPUT)main.o $(OUTPUT)parse.o $(OUTPUT)system.o $(OUTPUT)benchmark.o OBJS = $(OUTPUT)main.o $(OUTPUT)parse.o $(OUTPUT)system.o $(OUTPUT)benchmark.o
......
...@@ -28,7 +28,7 @@ static unsigned int sysfs_cpufreq_read_file(unsigned int cpu, const char *fname, ...@@ -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", snprintf(path, sizeof(path), PATH_TO_CPU "cpu%u/cpufreq/%s",
cpu, fname); 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 */ /* helper function to write a new value to a /sys file */
......
...@@ -319,7 +319,7 @@ static unsigned int sysfs_cpuidle_read_file(const char *fname, char *buf, ...@@ -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); snprintf(path, sizeof(path), PATH_TO_CPU "cpuidle/%s", fname);
return sysfs_read_file(path, buf, buflen); return cpupower_read_sysfs(path, buf, buflen);
} }
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
#include "cpupower.h" #include "cpupower.h"
#include "cpupower_intern.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; int fd;
ssize_t numread; ssize_t numread;
...@@ -95,7 +95,7 @@ static int sysfs_topology_read_file(unsigned int cpu, const char *fname, int *re ...@@ -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", snprintf(path, sizeof(path), PATH_TO_CPU "cpu%u/topology/%s",
cpu, fname); cpu, fname);
if (sysfs_read_file(path, linebuf, MAX_LINE_LEN) == 0) if (cpupower_read_sysfs(path, linebuf, MAX_LINE_LEN) == 0)
return -1; return -1;
*result = strtol(linebuf, &endp, 0); *result = strtol(linebuf, &endp, 0);
if (endp == linebuf || errno == ERANGE) if (endp == linebuf || errno == ERANGE)
......
...@@ -3,4 +3,4 @@ ...@@ -3,4 +3,4 @@
#define MAX_LINE_LEN 4096 #define MAX_LINE_LEN 4096
#define SYSFS_PATH_MAX 255 #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);
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment