diff options
author | Mike Gilbert <floppym@gentoo.org> | 2020-02-26 14:33:59 -0500 |
---|---|---|
committer | Shuah Khan <skhan@linuxfoundation.org> | 2020-03-02 08:53:34 -0700 |
commit | 2de7fb60a4740135e03cf55c1982e393ccb87b6b (patch) | |
tree | 522553c9f12a334acf423acbeb8610efd51bc6b7 /tools/power/cpupower/utils/idle_monitor/cpuidle_sysfs.c | |
parent | Linux 5.6-rc1 (diff) | |
download | linux-dev-2de7fb60a4740135e03cf55c1982e393ccb87b6b.tar.xz linux-dev-2de7fb60a4740135e03cf55c1982e393ccb87b6b.zip |
cpupower: avoid multiple definition with gcc -fno-common
Building cpupower with -fno-common in CFLAGS results in errors due to
multiple definitions of the 'cpu_count' and 'start_time' variables.
./utils/idle_monitor/snb_idle.o:./utils/idle_monitor/cpupower-monitor.h:28:
multiple definition of `cpu_count';
./utils/idle_monitor/nhm_idle.o:./utils/idle_monitor/cpupower-monitor.h:28:
first defined here
...
./utils/idle_monitor/cpuidle_sysfs.o:./utils/idle_monitor/cpuidle_sysfs.c:22:
multiple definition of `start_time';
./utils/idle_monitor/amd_fam14h_idle.o:./utils/idle_monitor/amd_fam14h_idle.c:85:
first defined here
The -fno-common option will be enabled by default in GCC 10.
Bug: https://bugs.gentoo.org/707462
Signed-off-by: Mike Gilbert <floppym@gentoo.org>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Diffstat (limited to 'tools/power/cpupower/utils/idle_monitor/cpuidle_sysfs.c')
-rw-r--r-- | tools/power/cpupower/utils/idle_monitor/cpuidle_sysfs.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/power/cpupower/utils/idle_monitor/cpuidle_sysfs.c b/tools/power/cpupower/utils/idle_monitor/cpuidle_sysfs.c index 3c4cee160b0e..a65f7d011513 100644 --- a/tools/power/cpupower/utils/idle_monitor/cpuidle_sysfs.c +++ b/tools/power/cpupower/utils/idle_monitor/cpuidle_sysfs.c @@ -19,7 +19,7 @@ struct cpuidle_monitor cpuidle_sysfs_monitor; static unsigned long long **previous_count; static unsigned long long **current_count; -struct timespec start_time; +static struct timespec start_time; static unsigned long long timediff; static int cpuidle_get_count_percent(unsigned int id, double *percent, |