All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] pinctrl: core: Add missing #ifdef CONFIG_GPIOLIB
@ 2020-10-28 10:39 He Zhe
  2020-10-28 11:41 ` Andy Shevchenko
  2020-11-05 13:53 ` Linus Walleij
  0 siblings, 2 replies; 3+ messages in thread
From: He Zhe @ 2020-10-28 10:39 UTC (permalink / raw)
  To: linus.walleij, drew, andy.shevchenko, linux-gpio, linux-kernel, zhe.he

To fix the following build warnings when CONFIG_GPIOLIB=n.

drivers/pinctrl/core.c:1607:20: warning: unused variable 'chip' [-Wunused-variable]
 1608 |  struct gpio_chip *chip;
      |                    ^~~~
drivers/pinctrl/core.c:1606:15: warning: unused variable 'gpio_num' [-Wunused-variable]
 1607 |  unsigned int gpio_num;
      |               ^~~~~~~~
drivers/pinctrl/core.c:1605:29: warning: unused variable 'range' [-Wunused-variable]
 1606 |  struct pinctrl_gpio_range *range;
      |                             ^~~~~

Fixes: f1b206cf7c57 ("pinctrl: core: print gpio in pins debugfs file")
Signed-off-by: He Zhe <zhe.he@windriver.com>
---
 drivers/pinctrl/core.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c
index 3663d87f51a0..9fc4433fece4 100644
--- a/drivers/pinctrl/core.c
+++ b/drivers/pinctrl/core.c
@@ -1602,9 +1602,11 @@ static int pinctrl_pins_show(struct seq_file *s, void *what)
 	struct pinctrl_dev *pctldev = s->private;
 	const struct pinctrl_ops *ops = pctldev->desc->pctlops;
 	unsigned i, pin;
+#ifdef CONFIG_GPIOLIB
 	struct pinctrl_gpio_range *range;
 	unsigned int gpio_num;
 	struct gpio_chip *chip;
+#endif
 
 	seq_printf(s, "registered pins: %d\n", pctldev->desc->npins);
 
-- 
2.17.1


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

* Re: [PATCH] pinctrl: core: Add missing #ifdef CONFIG_GPIOLIB
  2020-10-28 10:39 [PATCH] pinctrl: core: Add missing #ifdef CONFIG_GPIOLIB He Zhe
@ 2020-10-28 11:41 ` Andy Shevchenko
  2020-11-05 13:53 ` Linus Walleij
  1 sibling, 0 replies; 3+ messages in thread
From: Andy Shevchenko @ 2020-10-28 11:41 UTC (permalink / raw)
  To: He Zhe
  Cc: Linus Walleij, Drew Fustini, open list:GPIO SUBSYSTEM,
	Linux Kernel Mailing List

On Wed, Oct 28, 2020 at 12:40 PM He Zhe <zhe.he@windriver.com> wrote:
>
> To fix the following build warnings when CONFIG_GPIOLIB=n.
>
> drivers/pinctrl/core.c:1607:20: warning: unused variable 'chip' [-Wunused-variable]
>  1608 |  struct gpio_chip *chip;
>       |                    ^~~~
> drivers/pinctrl/core.c:1606:15: warning: unused variable 'gpio_num' [-Wunused-variable]
>  1607 |  unsigned int gpio_num;
>       |               ^~~~~~~~
> drivers/pinctrl/core.c:1605:29: warning: unused variable 'range' [-Wunused-variable]
>  1606 |  struct pinctrl_gpio_range *range;
>       |                             ^~~~~

Makes sense.
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>

> Fixes: f1b206cf7c57 ("pinctrl: core: print gpio in pins debugfs file")
> Signed-off-by: He Zhe <zhe.he@windriver.com>
> ---
>  drivers/pinctrl/core.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c
> index 3663d87f51a0..9fc4433fece4 100644
> --- a/drivers/pinctrl/core.c
> +++ b/drivers/pinctrl/core.c
> @@ -1602,9 +1602,11 @@ static int pinctrl_pins_show(struct seq_file *s, void *what)
>         struct pinctrl_dev *pctldev = s->private;
>         const struct pinctrl_ops *ops = pctldev->desc->pctlops;
>         unsigned i, pin;
> +#ifdef CONFIG_GPIOLIB
>         struct pinctrl_gpio_range *range;
>         unsigned int gpio_num;
>         struct gpio_chip *chip;
> +#endif
>
>         seq_printf(s, "registered pins: %d\n", pctldev->desc->npins);
>
> --
> 2.17.1
>


-- 
With Best Regards,
Andy Shevchenko

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

* Re: [PATCH] pinctrl: core: Add missing #ifdef CONFIG_GPIOLIB
  2020-10-28 10:39 [PATCH] pinctrl: core: Add missing #ifdef CONFIG_GPIOLIB He Zhe
  2020-10-28 11:41 ` Andy Shevchenko
@ 2020-11-05 13:53 ` Linus Walleij
  1 sibling, 0 replies; 3+ messages in thread
From: Linus Walleij @ 2020-11-05 13:53 UTC (permalink / raw)
  To: He Zhe, Chris Sorenson
  Cc: Drew Fustini, Andy Shevchenko, open list:GPIO SUBSYSTEM, linux-kernel

On Wed, Oct 28, 2020 at 11:40 AM He Zhe <zhe.he@windriver.com> wrote:

> To fix the following build warnings when CONFIG_GPIOLIB=n.
>
> drivers/pinctrl/core.c:1607:20: warning: unused variable 'chip' [-Wunused-variable]
>  1608 |  struct gpio_chip *chip;
>       |                    ^~~~
> drivers/pinctrl/core.c:1606:15: warning: unused variable 'gpio_num' [-Wunused-variable]
>  1607 |  unsigned int gpio_num;
>       |               ^~~~~~~~
> drivers/pinctrl/core.c:1605:29: warning: unused variable 'range' [-Wunused-variable]
>  1606 |  struct pinctrl_gpio_range *range;
>       |                             ^~~~~
>
> Fixes: f1b206cf7c57 ("pinctrl: core: print gpio in pins debugfs file")
> Signed-off-by: He Zhe <zhe.he@windriver.com>

Patch applied. I first applied a similar patch by Chris, but I realized
it ended up mixing code and declarations so I'll go for this one instead.

Yours,
Linus Walleij

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

end of thread, other threads:[~2020-11-05 13:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-28 10:39 [PATCH] pinctrl: core: Add missing #ifdef CONFIG_GPIOLIB He Zhe
2020-10-28 11:41 ` Andy Shevchenko
2020-11-05 13:53 ` Linus Walleij

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.