lkml.org 
[lkml]   [2020]   [Dec]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] pinctrl: core: Fix unused variable build warnings
On Mon, Nov 23, 2020 at 11:41 PM Pawan Gupta <writetopawan@gmail.com> wrote:

> A recent commit f1b206cf7c57 ("pinctrl: core: print gpio in pins debugfs
> file") added build warnings when CONFIG_GPIOLIB=n. Offcourse the kernel
> fails to build when warnings are treated as errors. Below is the error
> message:
>
> $ make CFLAGS_KERNEL+=-Werror
>
> drivers/pinctrl/core.c: In function ‘pinctrl_pins_show’:
> drivers/pinctrl/core.c:1607:20: error: unused variable ‘chip’ [-Werror=unused-variable]
> 1607 | struct gpio_chip *chip;
> | ^~~~
> drivers/pinctrl/core.c:1606:15: error: unused variable ‘gpio_num’ [-Werror=unused-variable]
> 1606 | unsigned int gpio_num;
> | ^~~~~~~~
> drivers/pinctrl/core.c:1605:29: error: unused variable ‘range’ [-Werror=unused-variable]
> 1605 | struct pinctrl_gpio_range *range;
> | ^~~~~
> cc1: all warnings being treated as errors
>
> These variables are only used inside #ifdef CONFIG_GPIOLIB, fix the
> build warnings by wrapping the definition inside the config.
>
> Fixes: f1b206cf7c57 ("pinctrl: core: print gpio in pins debugfs file")
> Signed-off-by: Pawan Gupta <writetopawan@gmail.com>

This was fixed in
commit b507cb92477ad85902783a183c5ce01d16296687
"pinctrl: core: Add missing #ifdef CONFIG_GPIOLIB"
On october 28.

Thanks anyways!

Yours,
Linus Walleij

\
 
 \ /
  Last update: 2020-12-02 00:09    [W:0.069 / U:7.368 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site