All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] gpio: merrifield: Remove set but not used variable 'irq_base'
@ 2019-10-10 13:52 zhengbin
  2019-10-10 14:12 ` Andy Shevchenko
  2019-10-10 14:16 ` Andy Shevchenko
  0 siblings, 2 replies; 3+ messages in thread
From: zhengbin @ 2019-10-10 13:52 UTC (permalink / raw)
  To: andriy.shevchenko, linus.walleij, bgolaszewski, linux-gpio; +Cc: zhengbin13

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(-)

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 */
--
2.7.4


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

* Re: [PATCH] gpio: merrifield: Remove set but not used variable 'irq_base'
  2019-10-10 13:52 [PATCH] gpio: merrifield: Remove set but not used variable 'irq_base' zhengbin
@ 2019-10-10 14:12 ` Andy Shevchenko
  2019-10-10 14:16 ` Andy Shevchenko
  1 sibling, 0 replies; 3+ messages in thread
From: Andy Shevchenko @ 2019-10-10 14:12 UTC (permalink / raw)
  To: zhengbin; +Cc: linus.walleij, bgolaszewski, linux-gpio

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

-- 
With Best Regards,
Andy Shevchenko



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

* Re: [PATCH] gpio: merrifield: Remove set but not used variable 'irq_base'
  2019-10-10 13:52 [PATCH] gpio: merrifield: Remove set but not used variable 'irq_base' zhengbin
  2019-10-10 14:12 ` Andy Shevchenko
@ 2019-10-10 14:16 ` Andy Shevchenko
  1 sibling, 0 replies; 3+ messages in thread
From: Andy Shevchenko @ 2019-10-10 14:16 UTC (permalink / raw)
  To: zhengbin; +Cc: linus.walleij, bgolaszewski, linux-gpio

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.

-- 
With Best Regards,
Andy Shevchenko



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

end of thread, other threads:[~2019-10-10 14:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-10 13:52 [PATCH] gpio: merrifield: Remove set but not used variable 'irq_base' zhengbin
2019-10-10 14:12 ` Andy Shevchenko
2019-10-10 14:16 ` Andy Shevchenko

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.