linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] thermal/intel_powerclamp: fix __percpu declaration of worker_data
@ 2019-01-19 16:15 Luc Van Oostenryck
  2019-01-30  9:59 ` Petr Mladek
  0 siblings, 1 reply; 4+ messages in thread
From: Luc Van Oostenryck @ 2019-01-19 16:15 UTC (permalink / raw)
  To: Zhang Rui; +Cc: Petr Mladek, linux-pm, linux-kernel, Luc Van Oostenryck

This variable is declared as:
	static struct powerclamp_worker_data * __percpu worker_data;
In other words, a percpu pointer to struct ...

But this variable not used like so but as a pointer to a percpu
struct powerclamp_worker_data.

So fix the declaration as:
	static struct powerclamp_worker_data __percpu *worker_data;

This also quiets Sparse's warnings from __verify_pcpu_ptr(), like:
  494:49: warning: incorrect type in initializer (different address spaces)
  494:49:    expected void const [noderef] <asn:3> *__vpp_verify
  494:49:    got struct powerclamp_worker_data *

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
---
 drivers/thermal/intel/intel_powerclamp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/thermal/intel/intel_powerclamp.c b/drivers/thermal/intel/intel_powerclamp.c
index 7571f7c2e..c7cba20bd 100644
--- a/drivers/thermal/intel/intel_powerclamp.c
+++ b/drivers/thermal/intel/intel_powerclamp.c
@@ -101,7 +101,7 @@ struct powerclamp_worker_data {
 	bool clamping;
 };
 
-static struct powerclamp_worker_data * __percpu worker_data;
+static struct powerclamp_worker_data __percpu * worker_data;
 static struct thermal_cooling_device *cooling_dev;
 static unsigned long *cpu_clamping_mask;  /* bit map for tracking per cpu
 					   * clamping kthread worker
-- 
2.20.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] thermal/intel_powerclamp: fix __percpu declaration of worker_data
  2019-01-19 16:15 [PATCH] thermal/intel_powerclamp: fix __percpu declaration of worker_data Luc Van Oostenryck
@ 2019-01-30  9:59 ` Petr Mladek
  2019-01-30 13:37   ` Zhang Rui
  0 siblings, 1 reply; 4+ messages in thread
From: Petr Mladek @ 2019-01-30  9:59 UTC (permalink / raw)
  To: Luc Van Oostenryck; +Cc: Zhang Rui, linux-pm, linux-kernel

On Sat 2019-01-19 17:15:23, Luc Van Oostenryck wrote:
> This variable is declared as:
> 	static struct powerclamp_worker_data * __percpu worker_data;
> In other words, a percpu pointer to struct ...
> 
> But this variable not used like so but as a pointer to a percpu
> struct powerclamp_worker_data.
> 
> So fix the declaration as:
> 	static struct powerclamp_worker_data __percpu *worker_data;
> 
> This also quiets Sparse's warnings from __verify_pcpu_ptr(), like:
>   494:49: warning: incorrect type in initializer (different address spaces)
>   494:49:    expected void const [noderef] <asn:3> *__vpp_verify
>   494:49:    got struct powerclamp_worker_data *
> 
> Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
> ---
>  drivers/thermal/intel/intel_powerclamp.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/thermal/intel/intel_powerclamp.c b/drivers/thermal/intel/intel_powerclamp.c
> index 7571f7c2e..c7cba20bd 100644
> --- a/drivers/thermal/intel/intel_powerclamp.c
> +++ b/drivers/thermal/intel/intel_powerclamp.c
> @@ -101,7 +101,7 @@ struct powerclamp_worker_data {
>  	bool clamping;
>  };
>  
> -static struct powerclamp_worker_data * __percpu worker_data;
> +static struct powerclamp_worker_data __percpu * worker_data;

Makes perfect sense. I wonder why I wrote it in the wrong order.

Reviewed-by: Petr Mladek <pmladek@suse.com>

Best Regards,
Petr

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] thermal/intel_powerclamp: fix __percpu declaration of worker_data
  2019-01-30  9:59 ` Petr Mladek
@ 2019-01-30 13:37   ` Zhang Rui
  2019-01-30 13:42     ` Zhang Rui
  0 siblings, 1 reply; 4+ messages in thread
From: Zhang Rui @ 2019-01-30 13:37 UTC (permalink / raw)
  To: Petr Mladek, Luc Van Oostenryck; +Cc: linux-pm, linux-kernel

On 三, 2019-01-30 at 10:59 +0100, Petr Mladek wrote:
> On Sat 2019-01-19 17:15:23, Luc Van Oostenryck wrote:
> > 
> > This variable is declared as:
> > 	static struct powerclamp_worker_data * __percpu worker_data;
> > In other words, a percpu pointer to struct ...
> > 
> > But this variable not used like so but as a pointer to a percpu
> > struct powerclamp_worker_data.
> > 
> > So fix the declaration as:
> > 	static struct powerclamp_worker_data __percpu *worker_data;
> > 
> > This also quiets Sparse's warnings from __verify_pcpu_ptr(), like:
> >   494:49: warning: incorrect type in initializer (different address
> > spaces)
> >   494:49:    expected void const [noderef] <asn:3> *__vpp_verify
> >   494:49:    got struct powerclamp_worker_data *
> > 
> > Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
> > ---
> >  drivers/thermal/intel/intel_powerclamp.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/thermal/intel/intel_powerclamp.c
> > b/drivers/thermal/intel/intel_powerclamp.c
> > index 7571f7c2e..c7cba20bd 100644
> > --- a/drivers/thermal/intel/intel_powerclamp.c
> > +++ b/drivers/thermal/intel/intel_powerclamp.c
> > @@ -101,7 +101,7 @@ struct powerclamp_worker_data {
> >  	bool clamping;
> >  };
> >  
> > -static struct powerclamp_worker_data * __percpu worker_data;
> > +static struct powerclamp_worker_data __percpu * worker_data;
> Makes perfect sense. I wonder why I wrote it in the wrong order.
> 
> Reviewed-by: Petr Mladek <pmladek@suse.com>
> 
applied and queued for next -rc.

thanks,
rui

> Best Regards,
> Petr

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] thermal/intel_powerclamp: fix __percpu declaration of worker_data
  2019-01-30 13:37   ` Zhang Rui
@ 2019-01-30 13:42     ` Zhang Rui
  0 siblings, 0 replies; 4+ messages in thread
From: Zhang Rui @ 2019-01-30 13:42 UTC (permalink / raw)
  To: Petr Mladek, Luc Van Oostenryck; +Cc: linux-pm, linux-kernel

On 三, 2019-01-30 at 21:37 +0800, Zhang Rui wrote:
> On 三, 2019-01-30 at 10:59 +0100, Petr Mladek wrote:
> > 
> > On Sat 2019-01-19 17:15:23, Luc Van Oostenryck wrote:
> > > 
> > > 
> > > This variable is declared as:
> > > 	static struct powerclamp_worker_data * __percpu worker_data;
> > > In other words, a percpu pointer to struct ...
> > > 
> > > But this variable not used like so but as a pointer to a percpu
> > > struct powerclamp_worker_data.
> > > 
> > > So fix the declaration as:
> > > 	static struct powerclamp_worker_data __percpu *worker_data;
> > > 
> > > This also quiets Sparse's warnings from __verify_pcpu_ptr(),
> > > like:
> > >   494:49: warning: incorrect type in initializer (different
> > > address
> > > spaces)
> > >   494:49:    expected void const [noderef] <asn:3> *__vpp_verify
> > >   494:49:    got struct powerclamp_worker_data *
> > > 
> > > Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
> > > ---
> > >  drivers/thermal/intel/intel_powerclamp.c | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > 
> > > diff --git a/drivers/thermal/intel/intel_powerclamp.c
> > > b/drivers/thermal/intel/intel_powerclamp.c
> > > index 7571f7c2e..c7cba20bd 100644
> > > --- a/drivers/thermal/intel/intel_powerclamp.c
> > > +++ b/drivers/thermal/intel/intel_powerclamp.c
> > > @@ -101,7 +101,7 @@ struct powerclamp_worker_data {
> > >  	bool clamping;
> > >  };
> > >  
> > > -static struct powerclamp_worker_data * __percpu worker_data;
> > > +static struct powerclamp_worker_data __percpu * worker_data;
> > Makes perfect sense. I wonder why I wrote it in the wrong order.
> > 
> > Reviewed-by: Petr Mladek <pmladek@suse.com>
> > 
> applied and queued for next -rc.
> 
well, just with a minor change to get rid of checkpatch warning.

ERROR: "foo * bar" should be "foo *bar"
#121: FILE: drivers/thermal/intel/intel_powerclamp.c:104:
+static struct powerclamp_worker_data __percpu * worker_data;

total: 1 errors, 0 warnings, 8 lines checked

thanks,
rui
> thanks,
> rui
> 
> > 
> > Best Regards,
> > Petr

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-01-30 13:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-19 16:15 [PATCH] thermal/intel_powerclamp: fix __percpu declaration of worker_data Luc Van Oostenryck
2019-01-30  9:59 ` Petr Mladek
2019-01-30 13:37   ` Zhang Rui
2019-01-30 13:42     ` Zhang Rui

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).