diff options
Diffstat (limited to 'tools/power/cpupower/utils/helpers/topology.c')
-rw-r--r-- | tools/power/cpupower/utils/helpers/topology.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/power/cpupower/utils/helpers/topology.c b/tools/power/cpupower/utils/helpers/topology.c index 5ad842b956bb..385ee5c7570c 100644 --- a/tools/power/cpupower/utils/helpers/topology.c +++ b/tools/power/cpupower/utils/helpers/topology.c | |||
@@ -22,17 +22,17 @@ | |||
22 | /* returns -1 on failure, 0 on success */ | 22 | /* returns -1 on failure, 0 on success */ |
23 | int sysfs_topology_read_file(unsigned int cpu, const char *fname) | 23 | int sysfs_topology_read_file(unsigned int cpu, const char *fname) |
24 | { | 24 | { |
25 | unsigned long value; | 25 | unsigned long value; |
26 | char linebuf[MAX_LINE_LEN]; | 26 | char linebuf[MAX_LINE_LEN]; |
27 | char *endp; | 27 | char *endp; |
28 | char path[SYSFS_PATH_MAX]; | 28 | char path[SYSFS_PATH_MAX]; |
29 | 29 | ||
30 | snprintf(path, sizeof(path), PATH_TO_CPU "cpu%u/topology/%s", | 30 | snprintf(path, sizeof(path), PATH_TO_CPU "cpu%u/topology/%s", |
31 | cpu, fname); | 31 | cpu, fname); |
32 | if (sysfs_read_file(path, linebuf, MAX_LINE_LEN) == 0 ) | 32 | if (sysfs_read_file(path, linebuf, MAX_LINE_LEN) == 0) |
33 | return -1; | 33 | return -1; |
34 | value = strtoul(linebuf, &endp, 0); | 34 | value = strtoul(linebuf, &endp, 0); |
35 | if ( endp == linebuf || errno == ERANGE ) | 35 | if (endp == linebuf || errno == ERANGE) |
36 | return -1; | 36 | return -1; |
37 | return value; | 37 | return value; |
38 | } | 38 | } |