Skip to content

Commit

Permalink
tools/power/cpupower: fix compilation with STATIC=true
Browse files Browse the repository at this point in the history
Rename duplicate sysfs_read_file into cpupower_read_sysfs and fix linking.

Signed-off-by: Konstantin Khlebnikov <[email protected]>
Acked-by: Thomas Renninger <[email protected]>
Cc: <[email protected]>
Signed-off-by: Shuah Khan (Samsung OSG) <[email protected]>
  • Loading branch information
koct9i authored and Shuah Khan committed Nov 6, 2018
1 parent 6510223 commit 9de9aa4
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion tools/power/cpupower/bench/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tools/power/cpupower/lib/cpufreq.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
2 changes: 1 addition & 1 deletion tools/power/cpupower/lib/cpuidle.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}


Expand Down
4 changes: 2 additions & 2 deletions tools/power/cpupower/lib/cpupower.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion tools/power/cpupower/lib/cpupower_intern.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

0 comments on commit 9de9aa4

Please sign in to comment.