All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marc Zyngier <maz@kernel.org>
To: Wei Yongjun <weiyongjun1@huawei.com>
Cc: Hulk Robot <hulkci@huawei.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Jason Cooper <jason@lakedaemon.net>,
	Shawn Guo <shawnguo@kernel.org>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Joakim Zhang <qiangqing.zhang@nxp.com>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH -next] irqchip/imx-intmux: Fix irqdata regs save in imx_intmux_runtime_suspend()
Date: Wed, 29 Jul 2020 17:59:37 +0100	[thread overview]
Message-ID: <46666de74c4b03142524f514ea64ddad@kernel.org> (raw)
In-Reply-To: <20200729155849.33919-1-weiyongjun1@huawei.com>

On 2020-07-29 16:58, Wei Yongjun wrote:
> Gcc report warning as follows:
> 
> drivers/irqchip/irq-imx-intmux.c:316:29: warning:
>  variable 'irqchip_data' set but not used [-Wunused-but-set-variable]
>   316 |  struct intmux_irqchip_data irqchip_data;
>       |                             ^~~~~~~~~~~~
> 
> irqdata regs is stored to this variable on the stack in
> imx_intmux_runtime_suspend(), which means a nop. this commit
> fix to save regs to the right place.
> 
> Fixes: bb403111e017 ("irqchip/imx-intmux: Implement intmux runtime
> power management")
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> ---
>  drivers/irqchip/irq-imx-intmux.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/irqchip/irq-imx-intmux.c 
> b/drivers/irqchip/irq-imx-intmux.c
> index 4c9e40d193d6..e35b7b09c3ab 100644
> --- a/drivers/irqchip/irq-imx-intmux.c
> +++ b/drivers/irqchip/irq-imx-intmux.c
> @@ -313,12 +313,12 @@ static int imx_intmux_remove(struct 
> platform_device *pdev)
>  static int imx_intmux_runtime_suspend(struct device *dev)
>  {
>  	struct intmux_data *data = dev_get_drvdata(dev);
> -	struct intmux_irqchip_data irqchip_data;
> +	struct intmux_irqchip_data *irqchip_data;
>  	int i;
> 
>  	for (i = 0; i < data->channum; i++) {
> -		irqchip_data = data->irqchip_data[i];
> -		irqchip_data.saved_reg = readl_relaxed(data->regs + CHANIER(i));
> +		irqchip_data = &data->irqchip_data[i];
> +		irqchip_data->saved_reg = readl_relaxed(data->regs + CHANIER(i));
>  	}
> 
>  	clk_disable_unprepare(data->ipg_clk);
> @@ -329,7 +329,7 @@ static int imx_intmux_runtime_suspend(struct device 
> *dev)
>  static int imx_intmux_runtime_resume(struct device *dev)
>  {
>  	struct intmux_data *data = dev_get_drvdata(dev);
> -	struct intmux_irqchip_data irqchip_data;
> +	struct intmux_irqchip_data *irqchip_data;
>  	int ret, i;
> 
>  	ret = clk_prepare_enable(data->ipg_clk);
> @@ -339,8 +339,8 @@ static int imx_intmux_runtime_resume(struct device 
> *dev)
>  	}
> 
>  	for (i = 0; i < data->channum; i++) {
> -		irqchip_data = data->irqchip_data[i];
> -		writel_relaxed(irqchip_data.saved_reg, data->regs + CHANIER(i));
> +		irqchip_data = &data->irqchip_data[i];
> +		writel_relaxed(irqchip_data->saved_reg, data->regs + CHANIER(i));
>  	}
> 
>  	return 0;

Amazing. Thanks for fixing this.

Johakim: I guess this was never tested, was it?

         M.
-- 
Jazz is not dead. It just smells funny...

WARNING: multiple messages have this Message-ID (diff)
From: Marc Zyngier <maz@kernel.org>
To: Wei Yongjun <weiyongjun1@huawei.com>
Cc: Jason Cooper <jason@lakedaemon.net>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Joakim Zhang <qiangqing.zhang@nxp.com>,
	linux-kernel@vger.kernel.org, Hulk Robot <hulkci@huawei.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Shawn Guo <shawnguo@kernel.org>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH -next] irqchip/imx-intmux: Fix irqdata regs save in imx_intmux_runtime_suspend()
Date: Wed, 29 Jul 2020 17:59:37 +0100	[thread overview]
Message-ID: <46666de74c4b03142524f514ea64ddad@kernel.org> (raw)
In-Reply-To: <20200729155849.33919-1-weiyongjun1@huawei.com>

On 2020-07-29 16:58, Wei Yongjun wrote:
> Gcc report warning as follows:
> 
> drivers/irqchip/irq-imx-intmux.c:316:29: warning:
>  variable 'irqchip_data' set but not used [-Wunused-but-set-variable]
>   316 |  struct intmux_irqchip_data irqchip_data;
>       |                             ^~~~~~~~~~~~
> 
> irqdata regs is stored to this variable on the stack in
> imx_intmux_runtime_suspend(), which means a nop. this commit
> fix to save regs to the right place.
> 
> Fixes: bb403111e017 ("irqchip/imx-intmux: Implement intmux runtime
> power management")
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> ---
>  drivers/irqchip/irq-imx-intmux.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/irqchip/irq-imx-intmux.c 
> b/drivers/irqchip/irq-imx-intmux.c
> index 4c9e40d193d6..e35b7b09c3ab 100644
> --- a/drivers/irqchip/irq-imx-intmux.c
> +++ b/drivers/irqchip/irq-imx-intmux.c
> @@ -313,12 +313,12 @@ static int imx_intmux_remove(struct 
> platform_device *pdev)
>  static int imx_intmux_runtime_suspend(struct device *dev)
>  {
>  	struct intmux_data *data = dev_get_drvdata(dev);
> -	struct intmux_irqchip_data irqchip_data;
> +	struct intmux_irqchip_data *irqchip_data;
>  	int i;
> 
>  	for (i = 0; i < data->channum; i++) {
> -		irqchip_data = data->irqchip_data[i];
> -		irqchip_data.saved_reg = readl_relaxed(data->regs + CHANIER(i));
> +		irqchip_data = &data->irqchip_data[i];
> +		irqchip_data->saved_reg = readl_relaxed(data->regs + CHANIER(i));
>  	}
> 
>  	clk_disable_unprepare(data->ipg_clk);
> @@ -329,7 +329,7 @@ static int imx_intmux_runtime_suspend(struct device 
> *dev)
>  static int imx_intmux_runtime_resume(struct device *dev)
>  {
>  	struct intmux_data *data = dev_get_drvdata(dev);
> -	struct intmux_irqchip_data irqchip_data;
> +	struct intmux_irqchip_data *irqchip_data;
>  	int ret, i;
> 
>  	ret = clk_prepare_enable(data->ipg_clk);
> @@ -339,8 +339,8 @@ static int imx_intmux_runtime_resume(struct device 
> *dev)
>  	}
> 
>  	for (i = 0; i < data->channum; i++) {
> -		irqchip_data = data->irqchip_data[i];
> -		writel_relaxed(irqchip_data.saved_reg, data->regs + CHANIER(i));
> +		irqchip_data = &data->irqchip_data[i];
> +		writel_relaxed(irqchip_data->saved_reg, data->regs + CHANIER(i));
>  	}
> 
>  	return 0;

Amazing. Thanks for fixing this.

Johakim: I guess this was never tested, was it?

         M.
-- 
Jazz is not dead. It just smells funny...

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2020-07-29 16:59 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-29 15:58 [PATCH -next] irqchip/imx-intmux: Fix irqdata regs save in imx_intmux_runtime_suspend() Wei Yongjun
2020-07-29 15:58 ` Wei Yongjun
2020-07-29 16:59 ` Marc Zyngier [this message]
2020-07-29 16:59   ` Marc Zyngier
2020-07-30  4:04   ` Joakim Zhang
2020-07-30  4:04     ` Joakim Zhang
2020-07-30 11:03 ` Marc Zyngier
2020-07-30 11:03   ` Marc Zyngier

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=46666de74c4b03142524f514ea64ddad@kernel.org \
    --to=maz@kernel.org \
    --cc=hulkci@huawei.com \
    --cc=jason@lakedaemon.net \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=qiangqing.zhang@nxp.com \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=weiyongjun1@huawei.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.