Skip to contentSkip to conversation

driver: pinctrl: fix unused variable warning

PATCH In review [email protected] 2 participants 2 messages Dec 11, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 driver: pinctrl: fix unused variable warning

From: Lei Chen <[email protected]>

In pinctrl_pins_show, range, gpio_num and chip variables are not used if CONFIG_GPIOLIB is not defined. Use this macro to wrap them.

---
 drivers/pinctrl/core.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/pinctrl/core.c +2 -0
index 3663d87..9fc4433 100644
@@ -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);
 
Signature · 1 line
1.8.3.1
#1 lore raw
Quoted 6 lines · On Fri, Dec 11, 2020 at 1:46 PM <[email protected]> wrote:

From: Lei Chen <[email protected]>

In pinctrl_pins_show, range, gpio_num and chip variables are not used if CONFIG_GPIOLIB is not defined. Use this macro to wrap them.

https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl.git/commit/drivers/pinctrl/core.c?h=for-next&id=b507cb92477ad85902783a183c5ce01d16296687

Rule of thumb: base your patches on the latest subsystem tree snapshot.

Signature · 2 lines
With Best Regards,
Andy Shevchenko