Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1569580 > unrolled thread

[PATCH] thermal/intel_powerclamp: Remove set-but-not-used variables

Started byAugusto Mecking Caringi <augustocaringi@gmail.com>
First post2017-01-30 11:50 +0100
Last post2017-01-31 17:30 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] thermal/intel_powerclamp: Remove set-but-not-used variables Augusto Mecking Caringi <augustocaringi@gmail.com> - 2017-01-30 11:50 +0100
    Re: [PATCH] thermal/intel_powerclamp: Remove set-but-not-used  variables Jacob Pan <jacob.jun.pan@linux.intel.com> - 2017-01-31 17:30 +0100

#1569580 — [PATCH] thermal/intel_powerclamp: Remove set-but-not-used variables

FromAugusto Mecking Caringi <augustocaringi@gmail.com>
Date2017-01-30 11:50 +0100
Subject[PATCH] thermal/intel_powerclamp: Remove set-but-not-used variables
Message-ID<t5hH5-2Un-31@gated-at.bofh.it>
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

[toc] | [next] | [standalone]


#1570884 — Re: [PATCH] thermal/intel_powerclamp: Remove set-but-not-used variables

FromJacob Pan <jacob.jun.pan@linux.intel.com>
Date2017-01-31 17:30 +0100
SubjectRe: [PATCH] thermal/intel_powerclamp: Remove set-but-not-used variables
Message-ID<t5JtF-2Tw-53@gated-at.bofh.it>
In reply to#1569580
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]

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web