diff mbox series

gpio: merrifield: Remove set but not used variable 'irq_base'

Message ID 1570715529-110344-1-git-send-email-zhengbin13@huawei.com
State New
Headers show
Series gpio: merrifield: Remove set but not used variable 'irq_base' | expand

Commit Message

Zheng Bin Oct. 10, 2019, 1:52 p.m. UTC
Fixes gcc '-Wunused-but-set-variable' warning:

drivers/gpio/gpio-merrifield.c: In function mrfld_gpio_probe:
drivers/gpio/gpio-merrifield.c:402:17: warning: variable irq_base set but not used [-Wunused-but-set-variable]

It is not used since commit 8f86a5b4ad67 ("gpio: merrifield:
Pass irqchip when adding gpiochip")

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: zhengbin <zhengbin13@huawei.com>
---
 drivers/gpio/gpio-merrifield.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--
2.7.4

Comments

Andy Shevchenko Oct. 10, 2019, 2:12 p.m. UTC | #1
On Thu, Oct 10, 2019 at 09:52:09PM +0800, zhengbin wrote:
> Fixes gcc '-Wunused-but-set-variable' warning:
> 
> drivers/gpio/gpio-merrifield.c: In function mrfld_gpio_probe:
> drivers/gpio/gpio-merrifield.c:402:17: warning: variable irq_base set but not used [-Wunused-but-set-variable]

> It is not used since commit 8f86a5b4ad67 ("gpio: merrifield:
> Pass irqchip when adding gpiochip")

...which is wrong. Please, see this [1] thread for the details.

NAK.

[1]: https://lore.kernel.org/linux-gpio/20191009165056.76580-1-andriy.shevchenko@linux.intel.com/T/#t
Andy Shevchenko Oct. 10, 2019, 2:16 p.m. UTC | #2
On Thu, Oct 10, 2019 at 09:52:09PM +0800, zhengbin wrote:

Side note below.

> -	irq_base = readl(base);
> +	readl(base);

Ouch! Not all cases are flush material of posted writes.


The below:

func(...)
{
	void __iomem *addr = x->y;
	...

	writel(z, addr);
	...
	readl(addr);
}

is fine to do like your bot did, but

func1(...)
{
	void __iomem *addr = x->y;
	...
	readl(addr);
}

often is not okay and probably the error somewhere else.

Please, consider to fix you bot.
diff mbox series

Patch

diff --git a/drivers/gpio/gpio-merrifield.c b/drivers/gpio/gpio-merrifield.c
index 4f27ddf..8d62e0a 100644
--- a/drivers/gpio/gpio-merrifield.c
+++ b/drivers/gpio/gpio-merrifield.c
@@ -399,7 +399,7 @@  static int mrfld_gpio_probe(struct pci_dev *pdev, const struct pci_device_id *id
 	const char *pinctrl_dev_name;
 	struct gpio_irq_chip *girq;
 	struct mrfld_gpio *priv;
-	u32 gpio_base, irq_base;
+	u32 gpio_base;
 	void __iomem *base;
 	unsigned int i;
 	int retval;
@@ -416,7 +416,7 @@  static int mrfld_gpio_probe(struct pci_dev *pdev, const struct pci_device_id *id

 	base = pcim_iomap_table(pdev)[1];

-	irq_base = readl(base);
+	readl(base);
 	gpio_base = readl(sizeof(u32) + base);

 	/* Release the IO mapping, since we already get the info from BAR1 */