2019-09-07 19:37:36

by Arnd Bergmann

[permalink] [raw]
Subject: [PATCH] [v2] pinctrl: intel: mark intel_pin_to_gpio __maybe_unused

The intel_pin_to_gpio() function is only called by the
PM support functions and causes a warning when those are disabled:

drivers/pinctrl/intel/pinctrl-intel.c:841:12: error: unused function 'intel_pin_to_gpio' [-Werror,-Wunused-function]

Mark it __maybe_unused to suppress the warning.

Suggested-by: Andy Shevchenko <[email protected]>
Signed-off-by: Arnd Bergmann <[email protected]>
---
v2: use __maybe_unused instead of moving the code
---
drivers/pinctrl/intel/pinctrl-intel.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pinctrl/intel/pinctrl-intel.c b/drivers/pinctrl/intel/pinctrl-intel.c
index d66fe2b4221b..1f13bcd0e4e1 100644
--- a/drivers/pinctrl/intel/pinctrl-intel.c
+++ b/drivers/pinctrl/intel/pinctrl-intel.c
@@ -838,7 +838,7 @@ static int intel_gpio_to_pin(struct intel_pinctrl *pctrl, unsigned int offset,
*
* Translate the pin number of pinctrl to GPIO offset
*/
-static int intel_pin_to_gpio(struct intel_pinctrl *pctrl, int pin)
+static __maybe_unused int intel_pin_to_gpio(struct intel_pinctrl *pctrl, int pin)
{
const struct intel_community *community;
const struct intel_padgroup *padgrp;
--
2.20.0


2019-09-09 15:15:44

by Andy Shevchenko

[permalink] [raw]
Subject: Re: [PATCH] [v2] pinctrl: intel: mark intel_pin_to_gpio __maybe_unused

On Fri, Sep 06, 2019 at 08:51:59PM +0200, Arnd Bergmann wrote:
> The intel_pin_to_gpio() function is only called by the
> PM support functions and causes a warning when those are disabled:
>
> drivers/pinctrl/intel/pinctrl-intel.c:841:12: error: unused function 'intel_pin_to_gpio' [-Werror,-Wunused-function]
>
> Mark it __maybe_unused to suppress the warning.
>

Acked-by: Andy Shevchenko <[email protected]>

> Suggested-by: Andy Shevchenko <[email protected]>
> Signed-off-by: Arnd Bergmann <[email protected]>
> ---
> v2: use __maybe_unused instead of moving the code
> ---
> drivers/pinctrl/intel/pinctrl-intel.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/pinctrl/intel/pinctrl-intel.c b/drivers/pinctrl/intel/pinctrl-intel.c
> index d66fe2b4221b..1f13bcd0e4e1 100644
> --- a/drivers/pinctrl/intel/pinctrl-intel.c
> +++ b/drivers/pinctrl/intel/pinctrl-intel.c
> @@ -838,7 +838,7 @@ static int intel_gpio_to_pin(struct intel_pinctrl *pctrl, unsigned int offset,
> *
> * Translate the pin number of pinctrl to GPIO offset
> */
> -static int intel_pin_to_gpio(struct intel_pinctrl *pctrl, int pin)
> +static __maybe_unused int intel_pin_to_gpio(struct intel_pinctrl *pctrl, int pin)
> {
> const struct intel_community *community;
> const struct intel_padgroup *padgrp;
> --
> 2.20.0
>

--
With Best Regards,
Andy Shevchenko


2019-09-09 18:24:09

by Chris Chiu

[permalink] [raw]
Subject: Re: [PATCH] [v2] pinctrl: intel: mark intel_pin_to_gpio __maybe_unused

On Sat, Sep 7, 2019 at 2:52 AM Arnd Bergmann <[email protected]> wrote:
>
> The intel_pin_to_gpio() function is only called by the
> PM support functions and causes a warning when those are disabled:
>
> drivers/pinctrl/intel/pinctrl-intel.c:841:12: error: unused function 'intel_pin_to_gpio' [-Werror,-Wunused-function]
>
> Mark it __maybe_unused to suppress the warning.
>
> Suggested-by: Andy Shevchenko <[email protected]>
> Signed-off-by: Arnd Bergmann <[email protected]>
Reviewed-by: Chris Chiu <[email protected]>

2019-09-10 04:35:12

by Mika Westerberg

[permalink] [raw]
Subject: Re: [PATCH] [v2] pinctrl: intel: mark intel_pin_to_gpio __maybe_unused

On Mon, Sep 09, 2019 at 12:22:11PM +0300, Andy Shevchenko wrote:
> On Fri, Sep 06, 2019 at 08:51:59PM +0200, Arnd Bergmann wrote:
> > The intel_pin_to_gpio() function is only called by the
> > PM support functions and causes a warning when those are disabled:
> >
> > drivers/pinctrl/intel/pinctrl-intel.c:841:12: error: unused function 'intel_pin_to_gpio' [-Werror,-Wunused-function]
> >
> > Mark it __maybe_unused to suppress the warning.
> >
>
> Acked-by: Andy Shevchenko <[email protected]>

Applied, thanks!