linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: chenlei0x@gmail.com
To: chenlei0x@gmail.com, linus.walleij@linaro.org,
	linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Lei Chen <lennychen@tencent.com>
Subject: [PATCH] driver: pinctrl: fix unused variable warning
Date: Fri, 11 Dec 2020 12:06:21 +0800	[thread overview]
Message-ID: <1607659581-15764-1-git-send-email-lennychen@tencent.com> (raw)

From: Lei Chen <lennychen@tencent.com>

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.

Signed-off-by: Lei Chen <lennychen@tencent.com>
---
 drivers/pinctrl/core.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c
index 3663d87..9fc4433 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);
 
-- 
1.8.3.1


             reply	other threads:[~2020-12-11  4:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-11  4:06 chenlei0x [this message]
2020-12-11 18:58 ` [PATCH] driver: pinctrl: fix unused variable warning Andy Shevchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1607659581-15764-1-git-send-email-lennychen@tencent.com \
    --to=chenlei0x@gmail.com \
    --cc=lennychen@tencent.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).