linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] thermal: devfreq_cooling: inline all stubs for CONFIG_DEVFREQ_THERMAL=n
@ 2020-04-03 20:51 Martin Blumenstingl
  2020-04-06 11:10 ` Thomas Zimmermann
  0 siblings, 1 reply; 2+ messages in thread
From: Martin Blumenstingl @ 2020-04-03 20:51 UTC (permalink / raw)
  To: rui.zhang, daniel.lezcano, amit.kucheria, linux-pm
  Cc: linux-kernel, javi.merino, edubezval, orjan.eide, tzimmermann,
	Martin Blumenstingl, stable

When CONFIG_DEVFREQ_THERMAL is disabled all functions except
of_devfreq_cooling_register_power() were already inlined. Also inline
the last function to avoid compile errors when multiple drivers call
of_devfreq_cooling_register_power() when CONFIG_DEVFREQ_THERMAL is not
set. Compilation failed with the following message:
  multiple definition of `of_devfreq_cooling_register_power'
(which then lists all usages of of_devfreq_cooling_register_power())

Thomas Zimmermann reported this problem [0] on a kernel config with
CONFIG_DRM_LIMA={m,y}, CONFIG_DRM_PANFROST={m,y} and
CONFIG_DEVFREQ_THERMAL=n after both, the lima and panfrost drivers
gained devfreq cooling support.

[0] https://www.spinics.net/lists/dri-devel/msg252825.html

Fixes: a76caf55e5b356 ("thermal: Add devfreq cooling")
Cc: stable@vger.kernel.org
Reported-by: Thomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
---
 include/linux/devfreq_cooling.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/devfreq_cooling.h b/include/linux/devfreq_cooling.h
index 4635f95000a4..79a6e37a1d6f 100644
--- a/include/linux/devfreq_cooling.h
+++ b/include/linux/devfreq_cooling.h
@@ -75,7 +75,7 @@ void devfreq_cooling_unregister(struct thermal_cooling_device *dfc);
 
 #else /* !CONFIG_DEVFREQ_THERMAL */
 
-struct thermal_cooling_device *
+static inline struct thermal_cooling_device *
 of_devfreq_cooling_register_power(struct device_node *np, struct devfreq *df,
 				  struct devfreq_cooling_power *dfc_power)
 {
-- 
2.26.0


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

* Re: [PATCH] thermal: devfreq_cooling: inline all stubs for CONFIG_DEVFREQ_THERMAL=n
  2020-04-03 20:51 [PATCH] thermal: devfreq_cooling: inline all stubs for CONFIG_DEVFREQ_THERMAL=n Martin Blumenstingl
@ 2020-04-06 11:10 ` Thomas Zimmermann
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Zimmermann @ 2020-04-06 11:10 UTC (permalink / raw)
  To: Martin Blumenstingl, rui.zhang, daniel.lezcano, amit.kucheria, linux-pm
  Cc: linux-kernel, javi.merino, edubezval, orjan.eide, stable


[-- Attachment #1.1: Type: text/plain, Size: 1990 bytes --]



Am 03.04.20 um 22:51 schrieb Martin Blumenstingl:
> When CONFIG_DEVFREQ_THERMAL is disabled all functions except
> of_devfreq_cooling_register_power() were already inlined. Also inline
> the last function to avoid compile errors when multiple drivers call
> of_devfreq_cooling_register_power() when CONFIG_DEVFREQ_THERMAL is not
> set. Compilation failed with the following message:
>   multiple definition of `of_devfreq_cooling_register_power'
> (which then lists all usages of of_devfreq_cooling_register_power())
> 
> Thomas Zimmermann reported this problem [0] on a kernel config with
> CONFIG_DRM_LIMA={m,y}, CONFIG_DRM_PANFROST={m,y} and
> CONFIG_DEVFREQ_THERMAL=n after both, the lima and panfrost drivers
> gained devfreq cooling support.
> 
> [0] https://www.spinics.net/lists/dri-devel/msg252825.html
> 
> Fixes: a76caf55e5b356 ("thermal: Add devfreq cooling")
> Cc: stable@vger.kernel.org
> Reported-by: Thomas Zimmermann <tzimmermann@suse.de>
> Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>

Tested-by: Thomas Zimmermann <tzimmermann@suse.de>

> ---
>  include/linux/devfreq_cooling.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/linux/devfreq_cooling.h b/include/linux/devfreq_cooling.h
> index 4635f95000a4..79a6e37a1d6f 100644
> --- a/include/linux/devfreq_cooling.h
> +++ b/include/linux/devfreq_cooling.h
> @@ -75,7 +75,7 @@ void devfreq_cooling_unregister(struct thermal_cooling_device *dfc);
>  
>  #else /* !CONFIG_DEVFREQ_THERMAL */
>  
> -struct thermal_cooling_device *
> +static inline struct thermal_cooling_device *
>  of_devfreq_cooling_register_power(struct device_node *np, struct devfreq *df,
>  				  struct devfreq_cooling_power *dfc_power)
>  {
> 

-- 
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

end of thread, other threads:[~2020-04-06 11:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-03 20:51 [PATCH] thermal: devfreq_cooling: inline all stubs for CONFIG_DEVFREQ_THERMAL=n Martin Blumenstingl
2020-04-06 11:10 ` Thomas Zimmermann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).