[01/14] pinctrl: at91: use __maybe_unused to hide pm functions
diff mbox

Message ID 1456934350-1389172-2-git-send-email-arnd@arndb.de
State New
Headers show

Commit Message

Arnd Bergmann March 2, 2016, 3:58 p.m. UTC
The at91-pio4 pinctrl driver uses SET_SYSTEM_SLEEP_PM_OPS() to
conditionally set the correct suspend/resume options, but they
become unused when CONFIG_PM is disabled:

drivers/pinctrl/pinctrl-at91-pio4.c:827:12: error: 'atmel_pctrl_suspend' defined but not used [-Werror=unused-function]
drivers/pinctrl/pinctrl-at91-pio4.c:847:12: error: 'atmel_pctrl_resume' defined but not used [-Werror=unused-function]

This adds __maybe_unused annotations so the compiler knows
it can silently drop them instead of warning.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/pinctrl/pinctrl-at91-pio4.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Nicolas Ferre March 2, 2016, 4:06 p.m. UTC | #1
Le 02/03/2016 16:58, Arnd Bergmann a écrit :
> The at91-pio4 pinctrl driver uses SET_SYSTEM_SLEEP_PM_OPS() to
> conditionally set the correct suspend/resume options, but they
> become unused when CONFIG_PM is disabled:
> 
> drivers/pinctrl/pinctrl-at91-pio4.c:827:12: error: 'atmel_pctrl_suspend' defined but not used [-Werror=unused-function]
> drivers/pinctrl/pinctrl-at91-pio4.c:847:12: error: 'atmel_pctrl_resume' defined but not used [-Werror=unused-function]
> 
> This adds __maybe_unused annotations so the compiler knows
> it can silently drop them instead of warning.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Indeed, nice like this:
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>

Thanks, bye.


> ---
>  drivers/pinctrl/pinctrl-at91-pio4.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/pinctrl/pinctrl-at91-pio4.c b/drivers/pinctrl/pinctrl-at91-pio4.c
> index ee69db6ae1c7..4429312e848d 100644
> --- a/drivers/pinctrl/pinctrl-at91-pio4.c
> +++ b/drivers/pinctrl/pinctrl-at91-pio4.c
> @@ -824,7 +824,7 @@ static struct pinctrl_desc atmel_pinctrl_desc = {
>  	.pmxops		= &atmel_pmxops,
>  };
>  
> -static int atmel_pctrl_suspend(struct device *dev)
> +static int __maybe_unused atmel_pctrl_suspend(struct device *dev)
>  {
>  	struct platform_device *pdev = to_platform_device(dev);
>  	struct atmel_pioctrl *atmel_pioctrl = platform_get_drvdata(pdev);
> @@ -844,7 +844,7 @@ static int atmel_pctrl_suspend(struct device *dev)
>  	return 0;
>  }
>  
> -static int atmel_pctrl_resume(struct device *dev)
> +static int __maybe_unused atmel_pctrl_resume(struct device *dev)
>  {
>  	struct platform_device *pdev = to_platform_device(dev);
>  	struct atmel_pioctrl *atmel_pioctrl = platform_get_drvdata(pdev);
>
ludovic.desroches@atmel.com March 2, 2016, 4:47 p.m. UTC | #2
On Wed, Mar 02, 2016 at 04:58:53PM +0100, Arnd Bergmann wrote:
> The at91-pio4 pinctrl driver uses SET_SYSTEM_SLEEP_PM_OPS() to
> conditionally set the correct suspend/resume options, but they
> become unused when CONFIG_PM is disabled:
> 
> drivers/pinctrl/pinctrl-at91-pio4.c:827:12: error: 'atmel_pctrl_suspend' defined but not used [-Werror=unused-function]
> drivers/pinctrl/pinctrl-at91-pio4.c:847:12: error: 'atmel_pctrl_resume' defined but not used [-Werror=unused-function]
> 
> This adds __maybe_unused annotations so the compiler knows
> it can silently drop them instead of warning.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Ludovic Desroches <ludovic.desroches@atmel.com>

Thanks

> ---
>  drivers/pinctrl/pinctrl-at91-pio4.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/pinctrl/pinctrl-at91-pio4.c b/drivers/pinctrl/pinctrl-at91-pio4.c
> index ee69db6ae1c7..4429312e848d 100644
> --- a/drivers/pinctrl/pinctrl-at91-pio4.c
> +++ b/drivers/pinctrl/pinctrl-at91-pio4.c
> @@ -824,7 +824,7 @@ static struct pinctrl_desc atmel_pinctrl_desc = {
>  	.pmxops		= &atmel_pmxops,
>  };
>  
> -static int atmel_pctrl_suspend(struct device *dev)
> +static int __maybe_unused atmel_pctrl_suspend(struct device *dev)
>  {
>  	struct platform_device *pdev = to_platform_device(dev);
>  	struct atmel_pioctrl *atmel_pioctrl = platform_get_drvdata(pdev);
> @@ -844,7 +844,7 @@ static int atmel_pctrl_suspend(struct device *dev)
>  	return 0;
>  }
>  
> -static int atmel_pctrl_resume(struct device *dev)
> +static int __maybe_unused atmel_pctrl_resume(struct device *dev)
>  {
>  	struct platform_device *pdev = to_platform_device(dev);
>  	struct atmel_pioctrl *atmel_pioctrl = platform_get_drvdata(pdev);
> -- 
> 2.7.0
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Linus Walleij March 9, 2016, 4:09 a.m. UTC | #3
On Wed, Mar 2, 2016 at 10:58 PM, Arnd Bergmann <arnd@arndb.de> wrote:

> The at91-pio4 pinctrl driver uses SET_SYSTEM_SLEEP_PM_OPS() to
> conditionally set the correct suspend/resume options, but they
> become unused when CONFIG_PM is disabled:
>
> drivers/pinctrl/pinctrl-at91-pio4.c:827:12: error: 'atmel_pctrl_suspend' defined but not used [-Werror=unused-function]
> drivers/pinctrl/pinctrl-at91-pio4.c:847:12: error: 'atmel_pctrl_resume' defined but not used [-Werror=unused-function]
>
> This adds __maybe_unused annotations so the compiler knows
> it can silently drop them instead of warning.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Patch applied with the maintainer ACKs.

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch
diff mbox

diff --git a/drivers/pinctrl/pinctrl-at91-pio4.c b/drivers/pinctrl/pinctrl-at91-pio4.c
index ee69db6ae1c7..4429312e848d 100644
--- a/drivers/pinctrl/pinctrl-at91-pio4.c
+++ b/drivers/pinctrl/pinctrl-at91-pio4.c
@@ -824,7 +824,7 @@  static struct pinctrl_desc atmel_pinctrl_desc = {
 	.pmxops		= &atmel_pmxops,
 };
 
-static int atmel_pctrl_suspend(struct device *dev)
+static int __maybe_unused atmel_pctrl_suspend(struct device *dev)
 {
 	struct platform_device *pdev = to_platform_device(dev);
 	struct atmel_pioctrl *atmel_pioctrl = platform_get_drvdata(pdev);
@@ -844,7 +844,7 @@  static int atmel_pctrl_suspend(struct device *dev)
 	return 0;
 }
 
-static int atmel_pctrl_resume(struct device *dev)
+static int __maybe_unused atmel_pctrl_resume(struct device *dev)
 {
 	struct platform_device *pdev = to_platform_device(dev);
 	struct atmel_pioctrl *atmel_pioctrl = platform_get_drvdata(pdev);