]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
gpiolib: Mark gpio_suffixes array with __maybe_unused
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Mon, 9 Jul 2018 18:47:27 +0000 (21:47 +0300)
committerJuerg Haefliger <juergh@canonical.com>
Wed, 24 Jul 2019 01:49:23 +0000 (19:49 -0600)
commitb79a37571f82cc7faf3db50f23ad844993394b0e
tree0fc19a2d71f287b3def00c395cafc611ba1d2949
parentf61e9d968169d21a0c990a2e10b0c1d5de18adbe
gpiolib: Mark gpio_suffixes array with __maybe_unused

BugLink: https://bugs.launchpad.net/bugs/1836117
[ Upstream commit b23ec59926faf05b0c43680d05671c484e810ac4 ]

Since we put static variable to a header file it's copied to each module
that includes the header. But not all of them are actually used it.

Mark gpio_suffixes array with __maybe_unused to hide a compiler warning:

In file included from
drivers/gpio/gpiolib-legacy.c:6:0:
drivers/gpio/gpiolib.h:95:27: warning: ‘gpio_suffixes’ defined but not used [-Wunused-const-variable=]
 static const char * const gpio_suffixes[] = { "gpios", "gpio" };
                           ^~~~~~~~~~~~~
In file included from drivers/gpio/gpiolib-devprop.c:17:0:
drivers/gpio/gpiolib.h:95:27: warning: ‘gpio_suffixes’ defined but not used [-Wunused-const-variable=]
 static const char * const gpio_suffixes[] = { "gpios", "gpio" };
                           ^~~~~~~~~~~~~

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
drivers/gpio/gpiolib.h