From e9ab5139a3bf01f70fe0a0f01d85d027a551efb3 Mon Sep 17 00:00:00 2001 From: Ruben Kerkhof Date: Thu, 3 Mar 2016 22:14:45 +0100 Subject: [PATCH] Turbostat: fix shadowing issue MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit turbostat.c: In function ‘delta_thread’: turbostat.c:460:26: error: declaration of ‘core_delta’ shadows a global declaration [-Werror=shadow] const struct core_data *core_delta) ^~~~~~~~~~ turbostat.c:163:4: note: shadowed declaration is here } *core_delta, *core_even, *core_odd; ^~~~~~~~~~ --- src/turbostat.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/turbostat.c b/src/turbostat.c index 14ce29fd..7784e9b9 100644 --- a/src/turbostat.c +++ b/src/turbostat.c @@ -457,7 +457,7 @@ delta_core(struct core_data *delta, const struct core_data *new, const struct co */ static inline int __attribute__((warn_unused_result)) delta_thread(struct thread_data *delta, const struct thread_data *new, const struct thread_data *old, - const struct core_data *core_delta) + const struct core_data *cdelta) { delta->tsc = new->tsc - old->tsc; @@ -491,12 +491,12 @@ delta_thread(struct thread_data *delta, const struct thread_data *new, const str * it is possible for mperf's non-halted cycles + idle states * to exceed TSC's all cycles: show c1 = 0% in that case. */ - if ((delta->mperf + core_delta->c3 + core_delta->c6 + core_delta->c7) > delta->tsc) + if ((delta->mperf + cdelta->c3 + cdelta->c6 + cdelta->c7) > delta->tsc) delta->c1 = 0; else { /* normal case, derive c1 */ - delta->c1 = delta->tsc - delta->mperf - core_delta->c3 - - core_delta->c6 - core_delta->c7; + delta->c1 = delta->tsc - delta->mperf - cdelta->c3 + - cdelta->c6 - cdelta->c7; } if (delta->mperf == 0) { -- 2.30.2