All of lore.kernel.org
 help / color / mirror / Atom feed
From: Petr Mladek <pmladek@suse.com>
To: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Cc: Zhang Rui <rui.zhang@intel.com>,
	linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] thermal/intel_powerclamp: fix __percpu declaration of worker_data
Date: Wed, 30 Jan 2019 10:59:17 +0100	[thread overview]
Message-ID: <20190130095917.7uxdxrjvtaeydcol@pathway.suse.cz> (raw)
In-Reply-To: <20190119161523.87999-1-luc.vanoostenryck@gmail.com>

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

  reply	other threads:[~2019-01-30  9:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2019-01-30 13:37   ` Zhang Rui
2019-01-30 13:42     ` Zhang Rui

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190130095917.7uxdxrjvtaeydcol@pathway.suse.cz \
    --to=pmladek@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=luc.vanoostenryck@gmail.com \
    --cc=rui.zhang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.