Re: [PATCH] pinctrl: sp7021: fix unused function warning

From: Andy Shevchenko
Date: Wed Jan 04 2023 - 06:11:07 EST


On Thu, Dec 15, 2022 at 05:38:10PM +0100, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@xxxxxxxx>
>
> 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