All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] thermal: tegra: mark PM functions __maybe_unused
@ 2016-04-16 20:19 ` Arnd Bergmann
  0 siblings, 0 replies; 8+ messages in thread
From: Arnd Bergmann @ 2016-04-16 20:19 UTC (permalink / raw)
  To: Eduardo Valentin, Wei Ni
  Cc: Arnd Bergmann, Zhang Rui, Stephen Warren, Thierry Reding,
	Alexandre Courbot, linux-pm-u79uwXL29TY76Z2rM5mHXA,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

After the PM support has been added to this driver, we get
a harmless warning when that support is disabled at compile
time:

drivers/thermal/tegra/soctherm.c:641:12: error: 'soctherm_resume' defined but not used [-Werror=unused-function]
 static int soctherm_resume(struct device *dev)

This marks the two PM functions as __maybe_unused to shut up
the warning. This is preferred over adding an #ifdef around
them, as it is harder to get wrong, and provides better
compile-time coverage.

Signed-off-by: Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>
Fixes: a134b4143b65 ("thermal: tegra: add PM support")
---
 drivers/thermal/tegra/soctherm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/thermal/tegra/soctherm.c b/drivers/thermal/tegra/soctherm.c
index 559c74279eb8..be829d6e131c 100644
--- a/drivers/thermal/tegra/soctherm.c
+++ b/drivers/thermal/tegra/soctherm.c
@@ -629,7 +629,7 @@ static int tegra_soctherm_remove(struct platform_device *pdev)
 	return 0;
 }
 
-static int soctherm_suspend(struct device *dev)
+static int __maybe_unused soctherm_suspend(struct device *dev)
 {
 	struct platform_device *pdev = to_platform_device(dev);
 
@@ -638,7 +638,7 @@ static int soctherm_suspend(struct device *dev)
 	return 0;
 }
 
-static int soctherm_resume(struct device *dev)
+static int __maybe_unused soctherm_resume(struct device *dev)
 {
 	struct platform_device *pdev = to_platform_device(dev);
 	struct tegra_soctherm *tegra = platform_get_drvdata(pdev);
-- 
2.7.0

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

* [PATCH] thermal: tegra: mark PM functions __maybe_unused
@ 2016-04-16 20:19 ` Arnd Bergmann
  0 siblings, 0 replies; 8+ messages in thread
From: Arnd Bergmann @ 2016-04-16 20:19 UTC (permalink / raw)
  To: Eduardo Valentin, Wei Ni
  Cc: Arnd Bergmann, Zhang Rui, Stephen Warren, Thierry Reding,
	Alexandre Courbot, linux-pm, linux-tegra, linux-kernel

After the PM support has been added to this driver, we get
a harmless warning when that support is disabled at compile
time:

drivers/thermal/tegra/soctherm.c:641:12: error: 'soctherm_resume' defined but not used [-Werror=unused-function]
 static int soctherm_resume(struct device *dev)

This marks the two PM functions as __maybe_unused to shut up
the warning. This is preferred over adding an #ifdef around
them, as it is harder to get wrong, and provides better
compile-time coverage.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: a134b4143b65 ("thermal: tegra: add PM support")
---
 drivers/thermal/tegra/soctherm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/thermal/tegra/soctherm.c b/drivers/thermal/tegra/soctherm.c
index 559c74279eb8..be829d6e131c 100644
--- a/drivers/thermal/tegra/soctherm.c
+++ b/drivers/thermal/tegra/soctherm.c
@@ -629,7 +629,7 @@ static int tegra_soctherm_remove(struct platform_device *pdev)
 	return 0;
 }
 
-static int soctherm_suspend(struct device *dev)
+static int __maybe_unused soctherm_suspend(struct device *dev)
 {
 	struct platform_device *pdev = to_platform_device(dev);
 
@@ -638,7 +638,7 @@ static int soctherm_suspend(struct device *dev)
 	return 0;
 }
 
-static int soctherm_resume(struct device *dev)
+static int __maybe_unused soctherm_resume(struct device *dev)
 {
 	struct platform_device *pdev = to_platform_device(dev);
 	struct tegra_soctherm *tegra = platform_get_drvdata(pdev);
-- 
2.7.0

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

* Re: [PATCH] thermal: tegra: mark PM functions __maybe_unused
  2016-04-16 20:19 ` Arnd Bergmann
  (?)
@ 2016-04-18  7:15 ` Thierry Reding
       [not found]   ` <20160418071513.GA13078-EkSeR96xj6Pcmrwk2tT4+A@public.gmane.org>
  -1 siblings, 1 reply; 8+ messages in thread
From: Thierry Reding @ 2016-04-18  7:15 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Eduardo Valentin, Wei Ni, Zhang Rui, Stephen Warren,
	Alexandre Courbot, Jon Hunter, linux-pm, linux-tegra,
	linux-kernel

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

On Sat, Apr 16, 2016 at 10:19:33PM +0200, Arnd Bergmann wrote:
> After the PM support has been added to this driver, we get
> a harmless warning when that support is disabled at compile
> time:
> 
> drivers/thermal/tegra/soctherm.c:641:12: error: 'soctherm_resume' defined but not used [-Werror=unused-function]
>  static int soctherm_resume(struct device *dev)
> 
> This marks the two PM functions as __maybe_unused to shut up
> the warning. This is preferred over adding an #ifdef around
> them, as it is harder to get wrong, and provides better
> compile-time coverage.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Fixes: a134b4143b65 ("thermal: tegra: add PM support")
> ---
>  drivers/thermal/tegra/soctherm.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

The need for this should go away when Jon's generic power domain series
gets merged (hopefully very soon now) and enabled on 32-bit ARM. In the
meantime:

Acked-by: Thierry Reding <treding@nvidia.com>

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

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

* Re: [PATCH] thermal: tegra: mark PM functions __maybe_unused
  2016-04-18  7:15 ` Thierry Reding
@ 2016-04-19  2:35       ` Wei Ni
  0 siblings, 0 replies; 8+ messages in thread
From: Wei Ni @ 2016-04-19  2:35 UTC (permalink / raw)
  To: Thierry Reding, Arnd Bergmann
  Cc: Eduardo Valentin, Zhang Rui, Stephen Warren, Alexandre Courbot,
	Jon Hunter, linux-pm-u79uwXL29TY76Z2rM5mHXA,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA



On 2016年04月18日 15:15, Thierry Reding wrote:
> * PGP Signed by an unknown key
> 
> On Sat, Apr 16, 2016 at 10:19:33PM +0200, Arnd Bergmann wrote:
>> After the PM support has been added to this driver, we get
>> a harmless warning when that support is disabled at compile
>> time:
>>
>> drivers/thermal/tegra/soctherm.c:641:12: error: 'soctherm_resume' defined but not used [-Werror=unused-function]
>>  static int soctherm_resume(struct device *dev)
>>
>> This marks the two PM functions as __maybe_unused to shut up
>> the warning. This is preferred over adding an #ifdef around
>> them, as it is harder to get wrong, and provides better
>> compile-time coverage.
>>
>> Signed-off-by: Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>
>> Fixes: a134b4143b65 ("thermal: tegra: add PM support")
>> ---
>>  drivers/thermal/tegra/soctherm.c | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> The need for this should go away when Jon's generic power domain series

Hi Thierry,
Could you please show me the Jon's generic power domain series, so that I can
verify it.

Thanks.

> gets merged (hopefully very soon now) and enabled on 32-bit ARM. In the
> meantime:
> 
> Acked-by: Thierry Reding <treding-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
> 
> * Unknown Key
> * 0x7F3EB3A1
> 

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

* Re: [PATCH] thermal: tegra: mark PM functions __maybe_unused
@ 2016-04-19  2:35       ` Wei Ni
  0 siblings, 0 replies; 8+ messages in thread
From: Wei Ni @ 2016-04-19  2:35 UTC (permalink / raw)
  To: Thierry Reding, Arnd Bergmann
  Cc: Eduardo Valentin, Zhang Rui, Stephen Warren, Alexandre Courbot,
	Jon Hunter, linux-pm, linux-tegra, linux-kernel



On 2016年04月18日 15:15, Thierry Reding wrote:
> * PGP Signed by an unknown key
> 
> On Sat, Apr 16, 2016 at 10:19:33PM +0200, Arnd Bergmann wrote:
>> After the PM support has been added to this driver, we get
>> a harmless warning when that support is disabled at compile
>> time:
>>
>> drivers/thermal/tegra/soctherm.c:641:12: error: 'soctherm_resume' defined but not used [-Werror=unused-function]
>>  static int soctherm_resume(struct device *dev)
>>
>> This marks the two PM functions as __maybe_unused to shut up
>> the warning. This is preferred over adding an #ifdef around
>> them, as it is harder to get wrong, and provides better
>> compile-time coverage.
>>
>> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
>> Fixes: a134b4143b65 ("thermal: tegra: add PM support")
>> ---
>>  drivers/thermal/tegra/soctherm.c | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> The need for this should go away when Jon's generic power domain series

Hi Thierry,
Could you please show me the Jon's generic power domain series, so that I can
verify it.

Thanks.

> gets merged (hopefully very soon now) and enabled on 32-bit ARM. In the
> meantime:
> 
> Acked-by: Thierry Reding <treding@nvidia.com>
> 
> * Unknown Key
> * 0x7F3EB3A1
> 

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

* Re: [PATCH] thermal: tegra: mark PM functions __maybe_unused
  2016-04-19  2:35       ` Wei Ni
  (?)
@ 2016-04-19 12:43       ` Thierry Reding
  2016-04-20  6:44           ` Wei Ni
  -1 siblings, 1 reply; 8+ messages in thread
From: Thierry Reding @ 2016-04-19 12:43 UTC (permalink / raw)
  To: Wei Ni
  Cc: Arnd Bergmann, Eduardo Valentin, Zhang Rui, Stephen Warren,
	Alexandre Courbot, Jon Hunter, linux-pm, linux-tegra,
	linux-kernel

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

On Tue, Apr 19, 2016 at 10:35:55AM +0800, Wei Ni wrote:
> 
> 
> On 2016年04月18日 15:15, Thierry Reding wrote:
> > * PGP Signed by an unknown key
> > 
> > On Sat, Apr 16, 2016 at 10:19:33PM +0200, Arnd Bergmann wrote:
> >> After the PM support has been added to this driver, we get
> >> a harmless warning when that support is disabled at compile
> >> time:
> >>
> >> drivers/thermal/tegra/soctherm.c:641:12: error: 'soctherm_resume' defined but not used [-Werror=unused-function]
> >>  static int soctherm_resume(struct device *dev)
> >>
> >> This marks the two PM functions as __maybe_unused to shut up
> >> the warning. This is preferred over adding an #ifdef around
> >> them, as it is harder to get wrong, and provides better
> >> compile-time coverage.
> >>
> >> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> >> Fixes: a134b4143b65 ("thermal: tegra: add PM support")
> >> ---
> >>  drivers/thermal/tegra/soctherm.c | 4 ++--
> >>  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > The need for this should go away when Jon's generic power domain series
> 
> Hi Thierry,
> Could you please show me the Jon's generic power domain series, so that I can
> verify it.

Here are the remaining patches from Jon's series:

	https://patchwork.ozlabs.org/patch/603285/
	https://patchwork.ozlabs.org/patch/603287/
	https://patchwork.ozlabs.org/patch/603284/

Thierry

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

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

* Re: [PATCH] thermal: tegra: mark PM functions __maybe_unused
  2016-04-19 12:43       ` Thierry Reding
@ 2016-04-20  6:44           ` Wei Ni
  0 siblings, 0 replies; 8+ messages in thread
From: Wei Ni @ 2016-04-20  6:44 UTC (permalink / raw)
  To: Thierry Reding
  Cc: Arnd Bergmann, Eduardo Valentin, Zhang Rui, Stephen Warren,
	Alexandre Courbot, Jon Hunter, linux-pm, linux-tegra,
	linux-kernel



On 2016年04月19日 20:43, Thierry Reding wrote:
> * PGP Signed by an unknown key
> 
> On Tue, Apr 19, 2016 at 10:35:55AM +0800, Wei Ni wrote:
>>
>>
>> On 2016年04月18日 15:15, Thierry Reding wrote:
>>>> Old Signed by an unknown key
>>>
>>> On Sat, Apr 16, 2016 at 10:19:33PM +0200, Arnd Bergmann wrote:
>>>> After the PM support has been added to this driver, we get
>>>> a harmless warning when that support is disabled at compile
>>>> time:
>>>>
>>>> drivers/thermal/tegra/soctherm.c:641:12: error: 'soctherm_resume' defined but not used [-Werror=unused-function]
>>>>  static int soctherm_resume(struct device *dev)
>>>>
>>>> This marks the two PM functions as __maybe_unused to shut up
>>>> the warning. This is preferred over adding an #ifdef around
>>>> them, as it is harder to get wrong, and provides better
>>>> compile-time coverage.
>>>>
>>>> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
>>>> Fixes: a134b4143b65 ("thermal: tegra: add PM support")
>>>> ---
>>>>  drivers/thermal/tegra/soctherm.c | 4 ++--
>>>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>>
>>> The need for this should go away when Jon's generic power domain series
>>
>> Hi Thierry,
>> Could you please show me the Jon's generic power domain series, so that I can
>> verify it.
> 
> Here are the remaining patches from Jon's series:
> 
> 	https://patchwork.ozlabs.org/patch/603285/
> 	https://patchwork.ozlabs.org/patch/603287/
> 	https://patchwork.ozlabs.org/patch/603284/

I checked this generic power domain series, it select PM and PM_GENERIC_DOMAINS
for Tegra SoC Family. But the soctherm_suspend/resume callbacks defined by
SIMPLE_DEV_PM_OPS are only used when the CONFIG_PM_SLEEP is enabled, so if the
CONFIG_PM_SLEEP is disabled, we still will get this warning.
So to avoid the warning, I think this patch is needed.

Wei.

> 
> Thierry
> 
> * Unknown Key
> * 0x7F3EB3A1
> 

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

* Re: [PATCH] thermal: tegra: mark PM functions __maybe_unused
@ 2016-04-20  6:44           ` Wei Ni
  0 siblings, 0 replies; 8+ messages in thread
From: Wei Ni @ 2016-04-20  6:44 UTC (permalink / raw)
  To: Thierry Reding
  Cc: Arnd Bergmann, Eduardo Valentin, Zhang Rui, Stephen Warren,
	Alexandre Courbot, Jon Hunter, linux-pm, linux-tegra,
	linux-kernel



On 2016年04月19日 20:43, Thierry Reding wrote:
> * PGP Signed by an unknown key
> 
> On Tue, Apr 19, 2016 at 10:35:55AM +0800, Wei Ni wrote:
>>
>>
>> On 2016年04月18日 15:15, Thierry Reding wrote:
>>>> Old Signed by an unknown key
>>>
>>> On Sat, Apr 16, 2016 at 10:19:33PM +0200, Arnd Bergmann wrote:
>>>> After the PM support has been added to this driver, we get
>>>> a harmless warning when that support is disabled at compile
>>>> time:
>>>>
>>>> drivers/thermal/tegra/soctherm.c:641:12: error: 'soctherm_resume' defined but not used [-Werror=unused-function]
>>>>  static int soctherm_resume(struct device *dev)
>>>>
>>>> This marks the two PM functions as __maybe_unused to shut up
>>>> the warning. This is preferred over adding an #ifdef around
>>>> them, as it is harder to get wrong, and provides better
>>>> compile-time coverage.
>>>>
>>>> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
>>>> Fixes: a134b4143b65 ("thermal: tegra: add PM support")
>>>> ---
>>>>  drivers/thermal/tegra/soctherm.c | 4 ++--
>>>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>>
>>> The need for this should go away when Jon's generic power domain series
>>
>> Hi Thierry,
>> Could you please show me the Jon's generic power domain series, so that I can
>> verify it.
> 
> Here are the remaining patches from Jon's series:
> 
> 	https://patchwork.ozlabs.org/patch/603285/
> 	https://patchwork.ozlabs.org/patch/603287/
> 	https://patchwork.ozlabs.org/patch/603284/

I checked this generic power domain series, it select PM and PM_GENERIC_DOMAINS
for Tegra SoC Family. But the soctherm_suspend/resume callbacks defined by
SIMPLE_DEV_PM_OPS are only used when the CONFIG_PM_SLEEP is enabled, so if the
CONFIG_PM_SLEEP is disabled, we still will get this warning.
So to avoid the warning, I think this patch is needed.

Wei.

> 
> Thierry
> 
> * Unknown Key
> * 0x7F3EB3A1
> 

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

end of thread, other threads:[~2016-04-20  6:44 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-16 20:19 [PATCH] thermal: tegra: mark PM functions __maybe_unused Arnd Bergmann
2016-04-16 20:19 ` Arnd Bergmann
2016-04-18  7:15 ` Thierry Reding
     [not found]   ` <20160418071513.GA13078-EkSeR96xj6Pcmrwk2tT4+A@public.gmane.org>
2016-04-19  2:35     ` Wei Ni
2016-04-19  2:35       ` Wei Ni
2016-04-19 12:43       ` Thierry Reding
2016-04-20  6:44         ` Wei Ni
2016-04-20  6:44           ` Wei Ni

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.