* [PATCH] thermal/intel_powerclamp: Remove set-but-not-used variables
@ 2017-01-30 10:47 Augusto Mecking Caringi
2017-01-31 16:22 ` Jacob Pan
0 siblings, 1 reply; 2+ messages in thread
From: Augusto Mecking Caringi @ 2017-01-30 10:47 UTC (permalink / raw)
To: Zhang Rui
Cc: Augusto Mecking Caringi, Eduardo Valentin, Jacob Pan,
Rafael J. Wysocki, Petr Mladek, Sebastian Andrzej Siewior,
linux-pm, linux-kernel
In poll_pkg_cstate() function, the variables jiffies_last and
jiffies_now are set but never used.
This has been detected by building the driver with W=1:
drivers/thermal/intel_powerclamp.c: In function ‘poll_pkg_cstate’:
drivers/thermal/intel_powerclamp.c:464:23: warning: variable
‘jiffies_last’ set but not used [-Wunused-but-set-variable]
static unsigned long jiffies_last;
^
Signed-off-by: Augusto Mecking Caringi <augustocaringi@gmail.com>
---
drivers/thermal/intel_powerclamp.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/drivers/thermal/intel_powerclamp.c b/drivers/thermal/intel_powerclamp.c
index df64692..a47103a 100644
--- a/drivers/thermal/intel_powerclamp.c
+++ b/drivers/thermal/intel_powerclamp.c
@@ -461,16 +461,13 @@ static void poll_pkg_cstate(struct work_struct *dummy)
{
static u64 msr_last;
static u64 tsc_last;
- static unsigned long jiffies_last;
u64 msr_now;
- unsigned long jiffies_now;
u64 tsc_now;
u64 val64;
msr_now = pkg_state_counter();
tsc_now = rdtsc();
- jiffies_now = jiffies;
/* calculate pkg cstate vs tsc ratio */
if (!msr_last || !tsc_last)
@@ -485,7 +482,6 @@ static void poll_pkg_cstate(struct work_struct *dummy)
/* update record */
msr_last = msr_now;
- jiffies_last = jiffies_now;
tsc_last = tsc_now;
if (true == clamping)
--
2.7.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] thermal/intel_powerclamp: Remove set-but-not-used variables
2017-01-30 10:47 [PATCH] thermal/intel_powerclamp: Remove set-but-not-used variables Augusto Mecking Caringi
@ 2017-01-31 16:22 ` Jacob Pan
0 siblings, 0 replies; 2+ messages in thread
From: Jacob Pan @ 2017-01-31 16:22 UTC (permalink / raw)
To: Augusto Mecking Caringi
Cc: Zhang Rui, Eduardo Valentin, Rafael J. Wysocki, Petr Mladek,
Sebastian Andrzej Siewior, linux-pm, linux-kernel, jacob.jun.pan
On Mon, 30 Jan 2017 10:47:36 +0000
Augusto Mecking Caringi <augustocaringi@gmail.com> wrote:
> In poll_pkg_cstate() function, the variables jiffies_last and
> jiffies_now are set but never used.
>
> This has been detected by building the driver with W=1:
>
> drivers/thermal/intel_powerclamp.c: In function ‘poll_pkg_cstate’:
> drivers/thermal/intel_powerclamp.c:464:23: warning: variable
> ‘jiffies_last’ set but not used [-Wunused-but-set-variable]
> static unsigned long jiffies_last;
> ^
>
Acked-by: Jacob Pan <jacob.jun.pan@linux.intel.com>
Thanks,
> Signed-off-by: Augusto Mecking Caringi <augustocaringi@gmail.com>
> ---
> drivers/thermal/intel_powerclamp.c | 4 ----
> 1 file changed, 4 deletions(-)
>
> diff --git a/drivers/thermal/intel_powerclamp.c
> b/drivers/thermal/intel_powerclamp.c index df64692..a47103a 100644
> --- a/drivers/thermal/intel_powerclamp.c
> +++ b/drivers/thermal/intel_powerclamp.c
> @@ -461,16 +461,13 @@ static void poll_pkg_cstate(struct work_struct
> *dummy) {
> static u64 msr_last;
> static u64 tsc_last;
> - static unsigned long jiffies_last;
>
> u64 msr_now;
> - unsigned long jiffies_now;
> u64 tsc_now;
> u64 val64;
>
> msr_now = pkg_state_counter();
> tsc_now = rdtsc();
> - jiffies_now = jiffies;
>
> /* calculate pkg cstate vs tsc ratio */
> if (!msr_last || !tsc_last)
> @@ -485,7 +482,6 @@ static void poll_pkg_cstate(struct work_struct
> *dummy)
> /* update record */
> msr_last = msr_now;
> - jiffies_last = jiffies_now;
> tsc_last = tsc_now;
>
> if (true == clamping)
[Jacob Pan]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-01-31 16:22 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-30 10:47 [PATCH] thermal/intel_powerclamp: Remove set-but-not-used variables Augusto Mecking Caringi
2017-01-31 16:22 ` Jacob Pan
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.