[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200729155849.33919-1-weiyongjun1@huawei.com>
Date: Wed, 29 Jul 2020 23:58:49 +0800
From: Wei Yongjun <weiyongjun1@...wei.com>
To: Hulk Robot <hulkci@...wei.com>,
Thomas Gleixner <tglx@...utronix.de>,
Jason Cooper <jason@...edaemon.net>,
Marc Zyngier <maz@...nel.org>, Shawn Guo <shawnguo@...nel.org>,
Sascha Hauer <s.hauer@...gutronix.de>,
Joakim Zhang <qiangqing.zhang@....com>
CC: Wei Yongjun <weiyongjun1@...wei.com>,
<linux-arm-kernel@...ts.infradead.org>,
<linux-kernel@...r.kernel.org>
Subject: [PATCH -next] irqchip/imx-intmux: Fix irqdata regs save in imx_intmux_runtime_suspend()
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@...wei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@...wei.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;
Powered by blists - more mailing lists