[PATCH] pinctrl: sp7021: fix unused function warning

Andy Shevchenko andriy.shevchenko at intel.com
Wed Jan 4 03:10:55 PST 2023


On Thu, Dec 15, 2022 at 05:38:10PM +0100, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd at arndb.de>
> 
> sppctl_gpio_inv_get is only used from the debugfs code inside
> of an #ifdef, so we get a warning without that:
> 
> drivers/pinctrl/sunplus/sppctl.c:393:12: error: 'sppctl_gpio_inv_get' defined but not used [-Werror=unused-function]
>   393 | static int sppctl_gpio_inv_get(struct gpio_chip *chip, unsigned int offset)
>       |            ^~~~~~~~~~~~~~~~~~~
> 
> Replace the #ifdef with an IS_ENABLED() check that avoids the warning.

I;m wondering why we can't use PTR_IF() here and in similar cases...

-- 
With Best Regards,
Andy Shevchenko





More information about the linux-arm-kernel mailing list