All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mmc: sunxi: mark PM functions as __maybe_unused
@ 2018-05-25 21:07 ` Arnd Bergmann
  0 siblings, 0 replies; 16+ messages in thread
From: Arnd Bergmann @ 2018-05-25 21:07 UTC (permalink / raw)
  To: Ulf Hansson, Maxime Ripard, Chen-Yu Tsai
  Cc: Arnd Bergmann, linux-mmc, linux-arm-kernel, linux-kernel

The newly added runtime-pm functions cause a harmless warning
when CONFIG_PM is disabled:

drivers/mmc/host/sunxi-mmc.c:1452:12: error: 'sunxi_mmc_runtime_suspend' defined but not used [-Werror=unused-function]
 static int sunxi_mmc_runtime_suspend(struct device *dev)
            ^~~~~~~~~~~~~~~~~~~~~~~~~
drivers/mmc/host/sunxi-mmc.c:1435:12: error: 'sunxi_mmc_runtime_resume' defined but not used [-Werror=unused-function]
 static int sunxi_mmc_runtime_resume(struct device *dev)

This marks them as __maybe_unused to shut up the warning.

Fixes: 9a8e1e8cc2c0 ("mmc: sunxi: Add runtime_pm support")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/mmc/host/sunxi-mmc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/host/sunxi-mmc.c b/drivers/mmc/host/sunxi-mmc.c
index 97c6b79b7d6f..837888b96bd3 100644
--- a/drivers/mmc/host/sunxi-mmc.c
+++ b/drivers/mmc/host/sunxi-mmc.c
@@ -1432,7 +1432,7 @@ static int sunxi_mmc_remove(struct platform_device *pdev)
 	return 0;
 }
 
-static int sunxi_mmc_runtime_resume(struct device *dev)
+static int __maybe_unused sunxi_mmc_runtime_resume(struct device *dev)
 {
 	struct mmc_host	*mmc = dev_get_drvdata(dev);
 	struct sunxi_mmc_host *host = mmc_priv(mmc);
@@ -1449,7 +1449,7 @@ static int sunxi_mmc_runtime_resume(struct device *dev)
 	return 0;
 }
 
-static int sunxi_mmc_runtime_suspend(struct device *dev)
+static int __maybe_unused sunxi_mmc_runtime_suspend(struct device *dev)
 {
 	struct mmc_host	*mmc = dev_get_drvdata(dev);
 	struct sunxi_mmc_host *host = mmc_priv(mmc);
-- 
2.9.0

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH] mmc: sunxi: mark PM functions as __maybe_unused
@ 2018-05-25 21:07 ` Arnd Bergmann
  0 siblings, 0 replies; 16+ messages in thread
From: Arnd Bergmann @ 2018-05-25 21:07 UTC (permalink / raw)
  To: linux-arm-kernel

The newly added runtime-pm functions cause a harmless warning
when CONFIG_PM is disabled:

drivers/mmc/host/sunxi-mmc.c:1452:12: error: 'sunxi_mmc_runtime_suspend' defined but not used [-Werror=unused-function]
 static int sunxi_mmc_runtime_suspend(struct device *dev)
            ^~~~~~~~~~~~~~~~~~~~~~~~~
drivers/mmc/host/sunxi-mmc.c:1435:12: error: 'sunxi_mmc_runtime_resume' defined but not used [-Werror=unused-function]
 static int sunxi_mmc_runtime_resume(struct device *dev)

This marks them as __maybe_unused to shut up the warning.

Fixes: 9a8e1e8cc2c0 ("mmc: sunxi: Add runtime_pm support")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/mmc/host/sunxi-mmc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/host/sunxi-mmc.c b/drivers/mmc/host/sunxi-mmc.c
index 97c6b79b7d6f..837888b96bd3 100644
--- a/drivers/mmc/host/sunxi-mmc.c
+++ b/drivers/mmc/host/sunxi-mmc.c
@@ -1432,7 +1432,7 @@ static int sunxi_mmc_remove(struct platform_device *pdev)
 	return 0;
 }
 
-static int sunxi_mmc_runtime_resume(struct device *dev)
+static int __maybe_unused sunxi_mmc_runtime_resume(struct device *dev)
 {
 	struct mmc_host	*mmc = dev_get_drvdata(dev);
 	struct sunxi_mmc_host *host = mmc_priv(mmc);
@@ -1449,7 +1449,7 @@ static int sunxi_mmc_runtime_resume(struct device *dev)
 	return 0;
 }
 
-static int sunxi_mmc_runtime_suspend(struct device *dev)
+static int __maybe_unused sunxi_mmc_runtime_suspend(struct device *dev)
 {
 	struct mmc_host	*mmc = dev_get_drvdata(dev);
 	struct sunxi_mmc_host *host = mmc_priv(mmc);
-- 
2.9.0

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* Re: [PATCH] mmc: sunxi: mark PM functions as __maybe_unused
  2018-05-25 21:07 ` Arnd Bergmann
@ 2018-05-28  6:50   ` Maxime Ripard
  -1 siblings, 0 replies; 16+ messages in thread
From: Maxime Ripard @ 2018-05-28  6:50 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Ulf Hansson, Chen-Yu Tsai, linux-mmc, linux-arm-kernel, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 941 bytes --]

On Fri, May 25, 2018 at 11:07:42PM +0200, Arnd Bergmann wrote:
> The newly added runtime-pm functions cause a harmless warning
> when CONFIG_PM is disabled:
> 
> drivers/mmc/host/sunxi-mmc.c:1452:12: error: 'sunxi_mmc_runtime_suspend' defined but not used [-Werror=unused-function]
>  static int sunxi_mmc_runtime_suspend(struct device *dev)
>             ^~~~~~~~~~~~~~~~~~~~~~~~~
> drivers/mmc/host/sunxi-mmc.c:1435:12: error: 'sunxi_mmc_runtime_resume' defined but not used [-Werror=unused-function]
>  static int sunxi_mmc_runtime_resume(struct device *dev)
> 
> This marks them as __maybe_unused to shut up the warning.
> 
> Fixes: 9a8e1e8cc2c0 ("mmc: sunxi: Add runtime_pm support")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>

Thanks!
Maxime

-- 
Maxime Ripard, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [PATCH] mmc: sunxi: mark PM functions as __maybe_unused
@ 2018-05-28  6:50   ` Maxime Ripard
  0 siblings, 0 replies; 16+ messages in thread
From: Maxime Ripard @ 2018-05-28  6:50 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, May 25, 2018 at 11:07:42PM +0200, Arnd Bergmann wrote:
> The newly added runtime-pm functions cause a harmless warning
> when CONFIG_PM is disabled:
> 
> drivers/mmc/host/sunxi-mmc.c:1452:12: error: 'sunxi_mmc_runtime_suspend' defined but not used [-Werror=unused-function]
>  static int sunxi_mmc_runtime_suspend(struct device *dev)
>             ^~~~~~~~~~~~~~~~~~~~~~~~~
> drivers/mmc/host/sunxi-mmc.c:1435:12: error: 'sunxi_mmc_runtime_resume' defined but not used [-Werror=unused-function]
>  static int sunxi_mmc_runtime_resume(struct device *dev)
> 
> This marks them as __maybe_unused to shut up the warning.
> 
> Fixes: 9a8e1e8cc2c0 ("mmc: sunxi: Add runtime_pm support")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>

Thanks!
Maxime

-- 
Maxime Ripard, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20180528/7e148807/attachment.sig>

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] mmc: sunxi: mark PM functions as __maybe_unused
  2018-05-25 21:07 ` Arnd Bergmann
  (?)
@ 2018-05-28 11:04   ` Ulf Hansson
  -1 siblings, 0 replies; 16+ messages in thread
From: Ulf Hansson @ 2018-05-28 11:04 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Maxime Ripard, Chen-Yu Tsai, linux-mmc, Linux ARM,
	Linux Kernel Mailing List

On 25 May 2018 at 23:07, Arnd Bergmann <arnd@arndb.de> wrote:
> The newly added runtime-pm functions cause a harmless warning
> when CONFIG_PM is disabled:
>
> drivers/mmc/host/sunxi-mmc.c:1452:12: error: 'sunxi_mmc_runtime_suspend' defined but not used [-Werror=unused-function]
>  static int sunxi_mmc_runtime_suspend(struct device *dev)
>             ^~~~~~~~~~~~~~~~~~~~~~~~~
> drivers/mmc/host/sunxi-mmc.c:1435:12: error: 'sunxi_mmc_runtime_resume' defined but not used [-Werror=unused-function]
>  static int sunxi_mmc_runtime_resume(struct device *dev)
>
> This marks them as __maybe_unused to shut up the warning.

Most mmc drivers uses #ifdef CONFIG_PM instead of the __maybe_unused() option.

It's not a big deal, but consistency is always good. Would you mind changing?

Br
Uffe

>
> Fixes: 9a8e1e8cc2c0 ("mmc: sunxi: Add runtime_pm support")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  drivers/mmc/host/sunxi-mmc.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mmc/host/sunxi-mmc.c b/drivers/mmc/host/sunxi-mmc.c
> index 97c6b79b7d6f..837888b96bd3 100644
> --- a/drivers/mmc/host/sunxi-mmc.c
> +++ b/drivers/mmc/host/sunxi-mmc.c
> @@ -1432,7 +1432,7 @@ static int sunxi_mmc_remove(struct platform_device *pdev)
>         return 0;
>  }
>
> -static int sunxi_mmc_runtime_resume(struct device *dev)
> +static int __maybe_unused sunxi_mmc_runtime_resume(struct device *dev)
>  {
>         struct mmc_host *mmc = dev_get_drvdata(dev);
>         struct sunxi_mmc_host *host = mmc_priv(mmc);
> @@ -1449,7 +1449,7 @@ static int sunxi_mmc_runtime_resume(struct device *dev)
>         return 0;
>  }
>
> -static int sunxi_mmc_runtime_suspend(struct device *dev)
> +static int __maybe_unused sunxi_mmc_runtime_suspend(struct device *dev)
>  {
>         struct mmc_host *mmc = dev_get_drvdata(dev);
>         struct sunxi_mmc_host *host = mmc_priv(mmc);
> --
> 2.9.0
>

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] mmc: sunxi: mark PM functions as __maybe_unused
@ 2018-05-28 11:04   ` Ulf Hansson
  0 siblings, 0 replies; 16+ messages in thread
From: Ulf Hansson @ 2018-05-28 11:04 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Maxime Ripard, Chen-Yu Tsai, linux-mmc,
	Linux Kernel Mailing List, Linux ARM

On 25 May 2018 at 23:07, Arnd Bergmann <arnd@arndb.de> wrote:
> The newly added runtime-pm functions cause a harmless warning
> when CONFIG_PM is disabled:
>
> drivers/mmc/host/sunxi-mmc.c:1452:12: error: 'sunxi_mmc_runtime_suspend' defined but not used [-Werror=unused-function]
>  static int sunxi_mmc_runtime_suspend(struct device *dev)
>             ^~~~~~~~~~~~~~~~~~~~~~~~~
> drivers/mmc/host/sunxi-mmc.c:1435:12: error: 'sunxi_mmc_runtime_resume' defined but not used [-Werror=unused-function]
>  static int sunxi_mmc_runtime_resume(struct device *dev)
>
> This marks them as __maybe_unused to shut up the warning.

Most mmc drivers uses #ifdef CONFIG_PM instead of the __maybe_unused() option.

It's not a big deal, but consistency is always good. Would you mind changing?

Br
Uffe

>
> Fixes: 9a8e1e8cc2c0 ("mmc: sunxi: Add runtime_pm support")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  drivers/mmc/host/sunxi-mmc.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mmc/host/sunxi-mmc.c b/drivers/mmc/host/sunxi-mmc.c
> index 97c6b79b7d6f..837888b96bd3 100644
> --- a/drivers/mmc/host/sunxi-mmc.c
> +++ b/drivers/mmc/host/sunxi-mmc.c
> @@ -1432,7 +1432,7 @@ static int sunxi_mmc_remove(struct platform_device *pdev)
>         return 0;
>  }
>
> -static int sunxi_mmc_runtime_resume(struct device *dev)
> +static int __maybe_unused sunxi_mmc_runtime_resume(struct device *dev)
>  {
>         struct mmc_host *mmc = dev_get_drvdata(dev);
>         struct sunxi_mmc_host *host = mmc_priv(mmc);
> @@ -1449,7 +1449,7 @@ static int sunxi_mmc_runtime_resume(struct device *dev)
>         return 0;
>  }
>
> -static int sunxi_mmc_runtime_suspend(struct device *dev)
> +static int __maybe_unused sunxi_mmc_runtime_suspend(struct device *dev)
>  {
>         struct mmc_host *mmc = dev_get_drvdata(dev);
>         struct sunxi_mmc_host *host = mmc_priv(mmc);
> --
> 2.9.0
>

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [PATCH] mmc: sunxi: mark PM functions as __maybe_unused
@ 2018-05-28 11:04   ` Ulf Hansson
  0 siblings, 0 replies; 16+ messages in thread
From: Ulf Hansson @ 2018-05-28 11:04 UTC (permalink / raw)
  To: linux-arm-kernel

On 25 May 2018 at 23:07, Arnd Bergmann <arnd@arndb.de> wrote:
> The newly added runtime-pm functions cause a harmless warning
> when CONFIG_PM is disabled:
>
> drivers/mmc/host/sunxi-mmc.c:1452:12: error: 'sunxi_mmc_runtime_suspend' defined but not used [-Werror=unused-function]
>  static int sunxi_mmc_runtime_suspend(struct device *dev)
>             ^~~~~~~~~~~~~~~~~~~~~~~~~
> drivers/mmc/host/sunxi-mmc.c:1435:12: error: 'sunxi_mmc_runtime_resume' defined but not used [-Werror=unused-function]
>  static int sunxi_mmc_runtime_resume(struct device *dev)
>
> This marks them as __maybe_unused to shut up the warning.

Most mmc drivers uses #ifdef CONFIG_PM instead of the __maybe_unused() option.

It's not a big deal, but consistency is always good. Would you mind changing?

Br
Uffe

>
> Fixes: 9a8e1e8cc2c0 ("mmc: sunxi: Add runtime_pm support")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  drivers/mmc/host/sunxi-mmc.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mmc/host/sunxi-mmc.c b/drivers/mmc/host/sunxi-mmc.c
> index 97c6b79b7d6f..837888b96bd3 100644
> --- a/drivers/mmc/host/sunxi-mmc.c
> +++ b/drivers/mmc/host/sunxi-mmc.c
> @@ -1432,7 +1432,7 @@ static int sunxi_mmc_remove(struct platform_device *pdev)
>         return 0;
>  }
>
> -static int sunxi_mmc_runtime_resume(struct device *dev)
> +static int __maybe_unused sunxi_mmc_runtime_resume(struct device *dev)
>  {
>         struct mmc_host *mmc = dev_get_drvdata(dev);
>         struct sunxi_mmc_host *host = mmc_priv(mmc);
> @@ -1449,7 +1449,7 @@ static int sunxi_mmc_runtime_resume(struct device *dev)
>         return 0;
>  }
>
> -static int sunxi_mmc_runtime_suspend(struct device *dev)
> +static int __maybe_unused sunxi_mmc_runtime_suspend(struct device *dev)
>  {
>         struct mmc_host *mmc = dev_get_drvdata(dev);
>         struct sunxi_mmc_host *host = mmc_priv(mmc);
> --
> 2.9.0
>

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] mmc: sunxi: mark PM functions as __maybe_unused
  2018-05-28 11:04   ` Ulf Hansson
  (?)
@ 2018-05-28 11:13     ` Arnd Bergmann
  -1 siblings, 0 replies; 16+ messages in thread
From: Arnd Bergmann @ 2018-05-28 11:13 UTC (permalink / raw)
  To: Ulf Hansson
  Cc: Maxime Ripard, Chen-Yu Tsai, linux-mmc, Linux ARM,
	Linux Kernel Mailing List

On Mon, May 28, 2018 at 1:04 PM, Ulf Hansson <ulf.hansson@linaro.org> wrote:
> On 25 May 2018 at 23:07, Arnd Bergmann <arnd@arndb.de> wrote:
>> The newly added runtime-pm functions cause a harmless warning
>> when CONFIG_PM is disabled:
>>
>> drivers/mmc/host/sunxi-mmc.c:1452:12: error: 'sunxi_mmc_runtime_suspend' defined but not used [-Werror=unused-function]
>>  static int sunxi_mmc_runtime_suspend(struct device *dev)
>>             ^~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/mmc/host/sunxi-mmc.c:1435:12: error: 'sunxi_mmc_runtime_resume' defined but not used [-Werror=unused-function]
>>  static int sunxi_mmc_runtime_resume(struct device *dev)
>>
>> This marks them as __maybe_unused to shut up the warning.
>
> Most mmc drivers uses #ifdef CONFIG_PM instead of the __maybe_unused() option.
>
> It's not a big deal, but consistency is always good. Would you mind changing?

I'd prefer not to. Most uses of #ifdef CONFIG_PM that get introduced are wrong,
and cause additional randconfig warnings that I end up having to fix,
so I always
do it with __maybe_unused.

I don't mind if you treat my patch as a bug report and decide to fix
it differently
yourself, but you won't get that patch from me ;-)

       Arnd

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] mmc: sunxi: mark PM functions as __maybe_unused
@ 2018-05-28 11:13     ` Arnd Bergmann
  0 siblings, 0 replies; 16+ messages in thread
From: Arnd Bergmann @ 2018-05-28 11:13 UTC (permalink / raw)
  To: Ulf Hansson
  Cc: Maxime Ripard, Chen-Yu Tsai, linux-mmc,
	Linux Kernel Mailing List, Linux ARM

On Mon, May 28, 2018 at 1:04 PM, Ulf Hansson <ulf.hansson@linaro.org> wrote:
> On 25 May 2018 at 23:07, Arnd Bergmann <arnd@arndb.de> wrote:
>> The newly added runtime-pm functions cause a harmless warning
>> when CONFIG_PM is disabled:
>>
>> drivers/mmc/host/sunxi-mmc.c:1452:12: error: 'sunxi_mmc_runtime_suspend' defined but not used [-Werror=unused-function]
>>  static int sunxi_mmc_runtime_suspend(struct device *dev)
>>             ^~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/mmc/host/sunxi-mmc.c:1435:12: error: 'sunxi_mmc_runtime_resume' defined but not used [-Werror=unused-function]
>>  static int sunxi_mmc_runtime_resume(struct device *dev)
>>
>> This marks them as __maybe_unused to shut up the warning.
>
> Most mmc drivers uses #ifdef CONFIG_PM instead of the __maybe_unused() option.
>
> It's not a big deal, but consistency is always good. Would you mind changing?

I'd prefer not to. Most uses of #ifdef CONFIG_PM that get introduced are wrong,
and cause additional randconfig warnings that I end up having to fix,
so I always
do it with __maybe_unused.

I don't mind if you treat my patch as a bug report and decide to fix
it differently
yourself, but you won't get that patch from me ;-)

       Arnd

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [PATCH] mmc: sunxi: mark PM functions as __maybe_unused
@ 2018-05-28 11:13     ` Arnd Bergmann
  0 siblings, 0 replies; 16+ messages in thread
From: Arnd Bergmann @ 2018-05-28 11:13 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, May 28, 2018 at 1:04 PM, Ulf Hansson <ulf.hansson@linaro.org> wrote:
> On 25 May 2018 at 23:07, Arnd Bergmann <arnd@arndb.de> wrote:
>> The newly added runtime-pm functions cause a harmless warning
>> when CONFIG_PM is disabled:
>>
>> drivers/mmc/host/sunxi-mmc.c:1452:12: error: 'sunxi_mmc_runtime_suspend' defined but not used [-Werror=unused-function]
>>  static int sunxi_mmc_runtime_suspend(struct device *dev)
>>             ^~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/mmc/host/sunxi-mmc.c:1435:12: error: 'sunxi_mmc_runtime_resume' defined but not used [-Werror=unused-function]
>>  static int sunxi_mmc_runtime_resume(struct device *dev)
>>
>> This marks them as __maybe_unused to shut up the warning.
>
> Most mmc drivers uses #ifdef CONFIG_PM instead of the __maybe_unused() option.
>
> It's not a big deal, but consistency is always good. Would you mind changing?

I'd prefer not to. Most uses of #ifdef CONFIG_PM that get introduced are wrong,
and cause additional randconfig warnings that I end up having to fix,
so I always
do it with __maybe_unused.

I don't mind if you treat my patch as a bug report and decide to fix
it differently
yourself, but you won't get that patch from me ;-)

       Arnd

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] mmc: sunxi: mark PM functions as __maybe_unused
  2018-05-28 11:13     ` Arnd Bergmann
@ 2018-05-28 11:30       ` Ulf Hansson
  -1 siblings, 0 replies; 16+ messages in thread
From: Ulf Hansson @ 2018-05-28 11:30 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Maxime Ripard, Chen-Yu Tsai, linux-mmc, Linux ARM,
	Linux Kernel Mailing List

On 28 May 2018 at 13:13, Arnd Bergmann <arnd@arndb.de> wrote:
> On Mon, May 28, 2018 at 1:04 PM, Ulf Hansson <ulf.hansson@linaro.org> wrote:
>> On 25 May 2018 at 23:07, Arnd Bergmann <arnd@arndb.de> wrote:
>>> The newly added runtime-pm functions cause a harmless warning
>>> when CONFIG_PM is disabled:
>>>
>>> drivers/mmc/host/sunxi-mmc.c:1452:12: error: 'sunxi_mmc_runtime_suspend' defined but not used [-Werror=unused-function]
>>>  static int sunxi_mmc_runtime_suspend(struct device *dev)
>>>             ^~~~~~~~~~~~~~~~~~~~~~~~~
>>> drivers/mmc/host/sunxi-mmc.c:1435:12: error: 'sunxi_mmc_runtime_resume' defined but not used [-Werror=unused-function]
>>>  static int sunxi_mmc_runtime_resume(struct device *dev)
>>>
>>> This marks them as __maybe_unused to shut up the warning.
>>
>> Most mmc drivers uses #ifdef CONFIG_PM instead of the __maybe_unused() option.
>>
>> It's not a big deal, but consistency is always good. Would you mind changing?
>
> I'd prefer not to. Most uses of #ifdef CONFIG_PM that get introduced are wrong,
> and cause additional randconfig warnings that I end up having to fix,
> so I always
> do it with __maybe_unused.

Right.

>
> I don't mind if you treat my patch as a bug report and decide to fix
> it differently
> yourself, but you won't get that patch from me ;-)

No, worries then. As stated, it's not a big deal.

Applied for next!

Kind regads
Uffe

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [PATCH] mmc: sunxi: mark PM functions as __maybe_unused
@ 2018-05-28 11:30       ` Ulf Hansson
  0 siblings, 0 replies; 16+ messages in thread
From: Ulf Hansson @ 2018-05-28 11:30 UTC (permalink / raw)
  To: linux-arm-kernel

On 28 May 2018 at 13:13, Arnd Bergmann <arnd@arndb.de> wrote:
> On Mon, May 28, 2018 at 1:04 PM, Ulf Hansson <ulf.hansson@linaro.org> wrote:
>> On 25 May 2018 at 23:07, Arnd Bergmann <arnd@arndb.de> wrote:
>>> The newly added runtime-pm functions cause a harmless warning
>>> when CONFIG_PM is disabled:
>>>
>>> drivers/mmc/host/sunxi-mmc.c:1452:12: error: 'sunxi_mmc_runtime_suspend' defined but not used [-Werror=unused-function]
>>>  static int sunxi_mmc_runtime_suspend(struct device *dev)
>>>             ^~~~~~~~~~~~~~~~~~~~~~~~~
>>> drivers/mmc/host/sunxi-mmc.c:1435:12: error: 'sunxi_mmc_runtime_resume' defined but not used [-Werror=unused-function]
>>>  static int sunxi_mmc_runtime_resume(struct device *dev)
>>>
>>> This marks them as __maybe_unused to shut up the warning.
>>
>> Most mmc drivers uses #ifdef CONFIG_PM instead of the __maybe_unused() option.
>>
>> It's not a big deal, but consistency is always good. Would you mind changing?
>
> I'd prefer not to. Most uses of #ifdef CONFIG_PM that get introduced are wrong,
> and cause additional randconfig warnings that I end up having to fix,
> so I always
> do it with __maybe_unused.

Right.

>
> I don't mind if you treat my patch as a bug report and decide to fix
> it differently
> yourself, but you won't get that patch from me ;-)

No, worries then. As stated, it's not a big deal.

Applied for next!

Kind regads
Uffe

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] mmc: sunxi: mark PM functions as __maybe_unused
  2018-05-28 11:13     ` Arnd Bergmann
@ 2018-05-28 12:12       ` Andy Shevchenko
  -1 siblings, 0 replies; 16+ messages in thread
From: Andy Shevchenko @ 2018-05-28 12:12 UTC (permalink / raw)
  To: Arnd Bergmann, Jean Delvare
  Cc: Ulf Hansson, Maxime Ripard, Chen-Yu Tsai, linux-mmc, Linux ARM,
	Linux Kernel Mailing List

+Cc: Jean

On Mon, May 28, 2018 at 2:13 PM, Arnd Bergmann <arnd@arndb.de> wrote:
> On Mon, May 28, 2018 at 1:04 PM, Ulf Hansson <ulf.hansson@linaro.org> wrote:
>> On 25 May 2018 at 23:07, Arnd Bergmann <arnd@arndb.de> wrote:
>>> The newly added runtime-pm functions cause a harmless warning
>>> when CONFIG_PM is disabled:
>>>
>>> drivers/mmc/host/sunxi-mmc.c:1452:12: error: 'sunxi_mmc_runtime_suspend' defined but not used [-Werror=unused-function]
>>>  static int sunxi_mmc_runtime_suspend(struct device *dev)
>>>             ^~~~~~~~~~~~~~~~~~~~~~~~~
>>> drivers/mmc/host/sunxi-mmc.c:1435:12: error: 'sunxi_mmc_runtime_resume' defined but not used [-Werror=unused-function]
>>>  static int sunxi_mmc_runtime_resume(struct device *dev)
>>>
>>> This marks them as __maybe_unused to shut up the warning.
>>
>> Most mmc drivers uses #ifdef CONFIG_PM instead of the __maybe_unused() option.
>>
>> It's not a big deal, but consistency is always good. Would you mind changing?
>
> I'd prefer not to. Most uses of #ifdef CONFIG_PM that get introduced are wrong,
> and cause additional randconfig warnings that I end up having to fix,
> so I always
> do it with __maybe_unused.

Some of the maintainers have strong objection against such changes.
http://lkml.iu.edu/hypermail/linux/kernel/1805.1/06100.html

It seems we might have a split in the opinions, which is not good in
this case (consistency for PM callbacks overall will be broken).

-- 
With Best Regards,
Andy Shevchenko

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [PATCH] mmc: sunxi: mark PM functions as __maybe_unused
@ 2018-05-28 12:12       ` Andy Shevchenko
  0 siblings, 0 replies; 16+ messages in thread
From: Andy Shevchenko @ 2018-05-28 12:12 UTC (permalink / raw)
  To: linux-arm-kernel

+Cc: Jean

On Mon, May 28, 2018 at 2:13 PM, Arnd Bergmann <arnd@arndb.de> wrote:
> On Mon, May 28, 2018 at 1:04 PM, Ulf Hansson <ulf.hansson@linaro.org> wrote:
>> On 25 May 2018 at 23:07, Arnd Bergmann <arnd@arndb.de> wrote:
>>> The newly added runtime-pm functions cause a harmless warning
>>> when CONFIG_PM is disabled:
>>>
>>> drivers/mmc/host/sunxi-mmc.c:1452:12: error: 'sunxi_mmc_runtime_suspend' defined but not used [-Werror=unused-function]
>>>  static int sunxi_mmc_runtime_suspend(struct device *dev)
>>>             ^~~~~~~~~~~~~~~~~~~~~~~~~
>>> drivers/mmc/host/sunxi-mmc.c:1435:12: error: 'sunxi_mmc_runtime_resume' defined but not used [-Werror=unused-function]
>>>  static int sunxi_mmc_runtime_resume(struct device *dev)
>>>
>>> This marks them as __maybe_unused to shut up the warning.
>>
>> Most mmc drivers uses #ifdef CONFIG_PM instead of the __maybe_unused() option.
>>
>> It's not a big deal, but consistency is always good. Would you mind changing?
>
> I'd prefer not to. Most uses of #ifdef CONFIG_PM that get introduced are wrong,
> and cause additional randconfig warnings that I end up having to fix,
> so I always
> do it with __maybe_unused.

Some of the maintainers have strong objection against such changes.
http://lkml.iu.edu/hypermail/linux/kernel/1805.1/06100.html

It seems we might have a split in the opinions, which is not good in
this case (consistency for PM callbacks overall will be broken).

-- 
With Best Regards,
Andy Shevchenko

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] mmc: sunxi: mark PM functions as __maybe_unused
  2018-05-28 12:12       ` Andy Shevchenko
@ 2018-05-28 15:15         ` Arnd Bergmann
  -1 siblings, 0 replies; 16+ messages in thread
From: Arnd Bergmann @ 2018-05-28 15:15 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Jean Delvare, Ulf Hansson, Maxime Ripard, Chen-Yu Tsai,
	linux-mmc, Linux ARM, Linux Kernel Mailing List

On Mon, May 28, 2018 at 2:12 PM, Andy Shevchenko
<andy.shevchenko@gmail.com> wrote:
> +Cc: Jean
>
> On Mon, May 28, 2018 at 2:13 PM, Arnd Bergmann <arnd@arndb.de> wrote:
>> On Mon, May 28, 2018 at 1:04 PM, Ulf Hansson <ulf.hansson@linaro.org> wrote:
>>> On 25 May 2018 at 23:07, Arnd Bergmann <arnd@arndb.de> wrote:
>>>> The newly added runtime-pm functions cause a harmless warning
>>>> when CONFIG_PM is disabled:
>>>>
>>>> drivers/mmc/host/sunxi-mmc.c:1452:12: error: 'sunxi_mmc_runtime_suspend' defined but not used [-Werror=unused-function]
>>>>  static int sunxi_mmc_runtime_suspend(struct device *dev)
>>>>             ^~~~~~~~~~~~~~~~~~~~~~~~~
>>>> drivers/mmc/host/sunxi-mmc.c:1435:12: error: 'sunxi_mmc_runtime_resume' defined but not used [-Werror=unused-function]
>>>>  static int sunxi_mmc_runtime_resume(struct device *dev)
>>>>
>>>> This marks them as __maybe_unused to shut up the warning.
>>>
>>> Most mmc drivers uses #ifdef CONFIG_PM instead of the __maybe_unused() option.
>>>
>>> It's not a big deal, but consistency is always good. Would you mind changing?
>>
>> I'd prefer not to. Most uses of #ifdef CONFIG_PM that get introduced are wrong,
>> and cause additional randconfig warnings that I end up having to fix,
>> so I always
>> do it with __maybe_unused.
>
> Some of the maintainers have strong objection against such changes.
> http://lkml.iu.edu/hypermail/linux/kernel/1805.1/06100.html
>
> It seems we might have a split in the opinions, which is not good in
> this case (consistency for PM callbacks overall will be broken).

We actually talked about this at the kernel summit last year, and the conclusion
was that we should replace the SET_RUNTIME_PM_OPS(),
SIMPLE_DEV_PM_OPS(), SET_SYSTEM_SLEEP_PM_OPS()
etc macros with new ones that don't require the ugly #ifdef and just silently
drop the unused functions.

Unfortunately we can't extend the existing macros to work that way (it
breaks for drivers that have an #ifdef today), and nobody could come up
with a new name that is at least as readable as the current one.

Note that incorrect #ifdef usage here is the most common source of
newly introduced build warnings and errors in the kernel, everyone gets
those wrong since they are just very confusing.

       Arnd

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [PATCH] mmc: sunxi: mark PM functions as __maybe_unused
@ 2018-05-28 15:15         ` Arnd Bergmann
  0 siblings, 0 replies; 16+ messages in thread
From: Arnd Bergmann @ 2018-05-28 15:15 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, May 28, 2018 at 2:12 PM, Andy Shevchenko
<andy.shevchenko@gmail.com> wrote:
> +Cc: Jean
>
> On Mon, May 28, 2018 at 2:13 PM, Arnd Bergmann <arnd@arndb.de> wrote:
>> On Mon, May 28, 2018 at 1:04 PM, Ulf Hansson <ulf.hansson@linaro.org> wrote:
>>> On 25 May 2018 at 23:07, Arnd Bergmann <arnd@arndb.de> wrote:
>>>> The newly added runtime-pm functions cause a harmless warning
>>>> when CONFIG_PM is disabled:
>>>>
>>>> drivers/mmc/host/sunxi-mmc.c:1452:12: error: 'sunxi_mmc_runtime_suspend' defined but not used [-Werror=unused-function]
>>>>  static int sunxi_mmc_runtime_suspend(struct device *dev)
>>>>             ^~~~~~~~~~~~~~~~~~~~~~~~~
>>>> drivers/mmc/host/sunxi-mmc.c:1435:12: error: 'sunxi_mmc_runtime_resume' defined but not used [-Werror=unused-function]
>>>>  static int sunxi_mmc_runtime_resume(struct device *dev)
>>>>
>>>> This marks them as __maybe_unused to shut up the warning.
>>>
>>> Most mmc drivers uses #ifdef CONFIG_PM instead of the __maybe_unused() option.
>>>
>>> It's not a big deal, but consistency is always good. Would you mind changing?
>>
>> I'd prefer not to. Most uses of #ifdef CONFIG_PM that get introduced are wrong,
>> and cause additional randconfig warnings that I end up having to fix,
>> so I always
>> do it with __maybe_unused.
>
> Some of the maintainers have strong objection against such changes.
> http://lkml.iu.edu/hypermail/linux/kernel/1805.1/06100.html
>
> It seems we might have a split in the opinions, which is not good in
> this case (consistency for PM callbacks overall will be broken).

We actually talked about this at the kernel summit last year, and the conclusion
was that we should replace the SET_RUNTIME_PM_OPS(),
SIMPLE_DEV_PM_OPS(), SET_SYSTEM_SLEEP_PM_OPS()
etc macros with new ones that don't require the ugly #ifdef and just silently
drop the unused functions.

Unfortunately we can't extend the existing macros to work that way (it
breaks for drivers that have an #ifdef today), and nobody could come up
with a new name that is at least as readable as the current one.

Note that incorrect #ifdef usage here is the most common source of
newly introduced build warnings and errors in the kernel, everyone gets
those wrong since they are just very confusing.

       Arnd

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2018-05-28 15:15 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-25 21:07 [PATCH] mmc: sunxi: mark PM functions as __maybe_unused Arnd Bergmann
2018-05-25 21:07 ` Arnd Bergmann
2018-05-28  6:50 ` Maxime Ripard
2018-05-28  6:50   ` Maxime Ripard
2018-05-28 11:04 ` Ulf Hansson
2018-05-28 11:04   ` Ulf Hansson
2018-05-28 11:04   ` Ulf Hansson
2018-05-28 11:13   ` Arnd Bergmann
2018-05-28 11:13     ` Arnd Bergmann
2018-05-28 11:13     ` Arnd Bergmann
2018-05-28 11:30     ` Ulf Hansson
2018-05-28 11:30       ` Ulf Hansson
2018-05-28 12:12     ` Andy Shevchenko
2018-05-28 12:12       ` Andy Shevchenko
2018-05-28 15:15       ` Arnd Bergmann
2018-05-28 15:15         ` Arnd Bergmann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.