linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH] pinctrl: ish-pfc: avoid unused variable warning
  2016-04-27  9:56 [PATCH] pinctrl: ish-pfc: avoid unused variable warning Arnd Bergmann
@ 2016-04-27  9:53 ` Laxman Dewangan
  2016-04-27 14:13 ` Sergei Shtylyov
  1 sibling, 0 replies; 3+ messages in thread
From: Laxman Dewangan @ 2016-04-27  9:53 UTC (permalink / raw)
  To: Arnd Bergmann, Laurent Pinchart, Geert Uytterhoeven, Linus Walleij
  Cc: Simon Horman, Wolfram Sang, Ulrich Hecht, Hisashi Nakamura,
	Takeshi Kihara, linux-renesas-soc, linux-gpio, linux-kernel


On Wednesday 27 April 2016 03:26 PM, Arnd Bergmann wrote:
> After the conversion to devm_pinctrl_register, we get a warning in
> sh_pfc_remove when CONFIG_PINCTRL_SH_PFC_GPIO is disabled:
>
> drivers/pinctrl/sh-pfc/core.c: In function 'sh_pfc_remove':
> drivers/pinctrl/sh-pfc/core.c:603:17: unused variable 'pfc' [-Werror=unused-variable]
>    struct sh_pfc *pfc = platform_get_drvdata(pdev);
>
> This moves the variable definition inside of the same ifdef
> that has the only user, to get a clean build again.
>


Similar patch from Geert also:
[PATCH] pinctrl: sh-pfc: Kill unused variable in sh_pfc_remove()

If devm_gpiochip_add_data() used then this may not be required.

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

* [PATCH] pinctrl: ish-pfc: avoid unused variable warning
@ 2016-04-27  9:56 Arnd Bergmann
  2016-04-27  9:53 ` Laxman Dewangan
  2016-04-27 14:13 ` Sergei Shtylyov
  0 siblings, 2 replies; 3+ messages in thread
From: Arnd Bergmann @ 2016-04-27  9:56 UTC (permalink / raw)
  To: Laurent Pinchart, Geert Uytterhoeven, Linus Walleij
  Cc: Arnd Bergmann, Simon Horman, Wolfram Sang, Ulrich Hecht,
	Laxman Dewangan, Hisashi Nakamura, Takeshi Kihara,
	linux-renesas-soc, linux-gpio, linux-kernel

After the conversion to devm_pinctrl_register, we get a warning in
sh_pfc_remove when CONFIG_PINCTRL_SH_PFC_GPIO is disabled:

drivers/pinctrl/sh-pfc/core.c: In function 'sh_pfc_remove':
drivers/pinctrl/sh-pfc/core.c:603:17: unused variable 'pfc' [-Werror=unused-variable]
  struct sh_pfc *pfc = platform_get_drvdata(pdev);

This moves the variable definition inside of the same ifdef
that has the only user, to get a clean build again.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 67ec8d7b4846 ("pinctrl: ish-pfc: Use devm_pinctrl_register() for pinctrl registration")
---
 drivers/pinctrl/sh-pfc/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pinctrl/sh-pfc/core.c b/drivers/pinctrl/sh-pfc/core.c
index 7ed9c80ba3ed..c9ee31c9952b 100644
--- a/drivers/pinctrl/sh-pfc/core.c
+++ b/drivers/pinctrl/sh-pfc/core.c
@@ -600,9 +600,9 @@ static int sh_pfc_probe(struct platform_device *pdev)
 
 static int sh_pfc_remove(struct platform_device *pdev)
 {
+#ifdef CONFIG_PINCTRL_SH_PFC_GPIO
 	struct sh_pfc *pfc = platform_get_drvdata(pdev);
 
-#ifdef CONFIG_PINCTRL_SH_PFC_GPIO
 	sh_pfc_unregister_gpiochip(pfc);
 #endif
 
-- 
2.7.0

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

* Re: [PATCH] pinctrl: ish-pfc: avoid unused variable warning
  2016-04-27  9:56 [PATCH] pinctrl: ish-pfc: avoid unused variable warning Arnd Bergmann
  2016-04-27  9:53 ` Laxman Dewangan
@ 2016-04-27 14:13 ` Sergei Shtylyov
  1 sibling, 0 replies; 3+ messages in thread
From: Sergei Shtylyov @ 2016-04-27 14:13 UTC (permalink / raw)
  To: Arnd Bergmann, Laurent Pinchart, Geert Uytterhoeven, Linus Walleij
  Cc: Simon Horman, Wolfram Sang, Ulrich Hecht, Laxman Dewangan,
	Hisashi Nakamura, Takeshi Kihara, linux-renesas-soc, linux-gpio,
	linux-kernel

Hello.

    s/ish-/sh-/ in the subject.

On 4/27/2016 12:56 PM, Arnd Bergmann wrote:

> After the conversion to devm_pinctrl_register, we get a warning in
> sh_pfc_remove when CONFIG_PINCTRL_SH_PFC_GPIO is disabled:
>
> drivers/pinctrl/sh-pfc/core.c: In function 'sh_pfc_remove':
> drivers/pinctrl/sh-pfc/core.c:603:17: unused variable 'pfc' [-Werror=unused-variable]
>   struct sh_pfc *pfc = platform_get_drvdata(pdev);
>
> This moves the variable definition inside of the same ifdef
> that has the only user, to get a clean build again.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Fixes: 67ec8d7b4846 ("pinctrl: ish-pfc: Use devm_pinctrl_register() for pinctrl registration")

    Ah, the broken patch also has this typo. :-)

WBR, Sergei

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

end of thread, other threads:[~2016-04-27 14:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-27  9:56 [PATCH] pinctrl: ish-pfc: avoid unused variable warning Arnd Bergmann
2016-04-27  9:53 ` Laxman Dewangan
2016-04-27 14:13 ` Sergei Shtylyov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).