Skip to content

Commit 4101e59

Browse files
andy-shevgregkh
authored andcommitted
gpiolib: Mark gpio_suffixes array with __maybe_unused
[ Upstream commit b23ec59 ] 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>
1 parent 492b804 commit 4101e59

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/gpio/gpiolib.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ struct acpi_gpio_info {
8888
};
8989

9090
/* gpio suffixes used for ACPI and device tree lookup */
91-
static const char * const gpio_suffixes[] = { "gpios", "gpio" };
91+
static __maybe_unused const char * const gpio_suffixes[] = { "gpios", "gpio" };
9292

9393
#ifdef CONFIG_OF_GPIO
9494
struct gpio_desc *of_find_gpio(struct device *dev,

0 commit comments

Comments
 (0)