Skip to contentSkip to conversation

randconfig warning fixes for thermal

PATCH In review Arnd Bergmann 4 participants 8 messages Jan 25, 2016 – Feb 9, 2016

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover randconfig warning fixes for thermal

These are three simple fixes for ARM randconfig builds:

[PATCH 1/3] thermal: spear: use __maybe_unused for PM functions [PATCH 2/3] thermal: allow spear-thermal driver to be a module [PATCH 3/3] thermal: allow u8500-thermal driver to be a module

All three bugs are on configurationsn that are not important and that rarely happen even with randconfig builds.

Arnd

#1 lore raw

PATCH 1/3 thermal: spear: use __maybe_unused for PM functions

The spear thermal driver hides its suspend/resume function conditionally based on CONFIG_PM, but references them based on CONFIG_PM_SLEEP, so we get a warning if the former is set but the latter is not:

thermal/spear_thermal.c:58:12: warning: 'spear_thermal_suspend' defined but not used [-Wunused-function] thermal/spear_thermal.c:75:12: warning: 'spear_thermal_resume' defined but not used [-Wunused-function]

This removes the #ifdef and instead uses a __maybe_uninitialized annotation to avoid the warning and improve compile-time coverage.

---
 drivers/thermal/spear_thermal.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/thermal/spear_thermal.c +2 -4
index 534dd9136662..81b35aace9de 100644
@@ -54,8 +54,7 @@ static struct thermal_zone_device_ops ops = {
 	.get_temp = thermal_get_temp,
 };
 
-#ifdef CONFIG_PM
-static int spear_thermal_suspend(struct device *dev)
+static int __maybe_unused spear_thermal_suspend(struct device *dev)
 {
 	struct platform_device *pdev = to_platform_device(dev);
 	struct thermal_zone_device *spear_thermal = platform_get_drvdata(pdev);
@@ -72,7 +71,7 @@ static int spear_thermal_suspend(struct device *dev)
 	return 0;
 }
 
-static int spear_thermal_resume(struct device *dev)
+static int __maybe_unused spear_thermal_resume(struct device *dev)
 {
 	struct platform_device *pdev = to_platform_device(dev);
 	struct thermal_zone_device *spear_thermal = platform_get_drvdata(pdev);
@@ -94,7 +93,6 @@ static int spear_thermal_resume(struct device *dev)
 
 	return 0;
 }
-#endif
 
 static SIMPLE_DEV_PM_OPS(spear_thermal_pm_ops, spear_thermal_suspend,
 		spear_thermal_resume);
Signature · 1 line
2.7.0
#2 lore raw

PATCH 2/3 thermal: allow spear-thermal driver to be a module

In reply to Arnd Bergmann

When the thermal subsystem is a loadable module, the spear driver fails to build:

drivers/thermal/built-in.o: In function `spear_thermal_exit':
spear_thermal.c:(.text+0xf8): undefined reference to thermal_zone_device_unregister' drivers/thermal/built-in.o: In function spear_thermal_probe':
spear_thermal.c:(.text+0x230): undefined reference to `thermal_zone_device_register'

This changes the symbol to a tristate, so Kconfig can track the dependency correctly.

---
 drivers/thermal/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/thermal/Kconfig +1 -1
index 8cc4ac64a91c..0852fd028dc9 100644
@@ -195,7 +195,7 @@ config IMX_THERMAL
 	  passive trip is crossed.
 
 config SPEAR_THERMAL
-	bool "SPEAr thermal sensor driver"
+	tristate "SPEAr thermal sensor driver"
 	depends on PLAT_SPEAR || COMPILE_TEST
 	depends on OF
 	help
Signature · 1 line
2.7.0
#3 lore raw

PATCH 3/3 thermal: allow u8500-thermal driver to be a module

In reply to Arnd Bergmann

When the thermal subsystem is a loadable module, the u8500 driver fails to build:

drivers/thermal/built-in.o: In function `db8500_thermal_probe':
db8500_thermal.c:(.text+0x96c): undefined reference to thermal_zone_device_register' drivers/thermal/built-in.o: In function db8500_thermal_work':
db8500_thermal.c:(.text+0xab4): undefined reference to `thermal_zone_device_update'

This changes the symbol to a tristate, so Kconfig can track the dependency correctly.

---
 drivers/mfd/db8500-prcmu.c | 3 +++
 drivers/thermal/Kconfig    | 4 ++--
 2 files changed, 5 insertions(+), 2 deletions(-)
drivers/mfd/db8500-prcmu.c +3 -0
index 2f4a1279b094..c0a86aeb1733 100644
@@ -2045,6 +2045,7 @@ int db8500_prcmu_config_hotmon(u8 low, u8 high)
 
 	return 0;
 }
+EXPORT_SYMBOL_GPL(db8500_prcmu_config_hotmon);
 
 static int config_hot_period(u16 val)
 {
@@ -2071,11 +2072,13 @@ int db8500_prcmu_start_temp_sense(u16 cycles32k)
 
 	return config_hot_period(cycles32k);
 }
+EXPORT_SYMBOL_GPL(db8500_prcmu_start_temp_sense);
 
 int db8500_prcmu_stop_temp_sense(void)
 {
 	return config_hot_period(0xFFFF);
 }
+EXPORT_SYMBOL_GPL(db8500_prcmu_stop_temp_sense);
 
 static int prcmu_a9wdog(u8 cmd, u8 d0, u8 d1, u8 d2, u8 d3)
 {
drivers/thermal/Kconfig +2 -2
index 0852fd028dc9..7c92c09be213 100644
@@ -237,8 +237,8 @@ config DOVE_THERMAL
 	  framework.
 
 config DB8500_THERMAL
-	bool "DB8500 thermal management"
-	depends on ARCH_U8500
+	tristate "DB8500 thermal management"
+	depends on MFD_DB8500_PRCMU
 	default y
 	help
 	  Adds DB8500 thermal management implementation according to the thermal
Signature · 1 line
2.7.0
Acked-by on v1 3/3
#4 lore raw

Re: [PATCH 3/3] thermal: allow u8500-thermal driver to be a module

Quoted 8 lines · Arnd Bergmann

When the thermal subsystem is a loadable module, the u8500 driver fails to build:

drivers/thermal/built-in.o: In function `db8500_thermal_probe':
db8500_thermal.c:(.text+0x96c): undefined reference to thermal_zone_device_register' drivers/thermal/built-in.o: In function db8500_thermal_work':
db8500_thermal.c:(.text+0xab4): undefined reference to `thermal_zone_device_update'

Quoted 8 lines

This changes the symbol to a tristate, so Kconfig can track the dependency correctly.

---
 drivers/mfd/db8500-prcmu.c | 3 +++
 drivers/thermal/Kconfig    | 4 ++--
 2 files changed, 5 insertions(+), 2 deletions(-)

As this touches a core Thermal file, I think it's better off going in via that tree. If that's a problem, I can take it with the relevant Acks.

Quoted 41 lines
drivers/mfd/db8500-prcmu.c +3 -0
index 2f4a1279b094..c0a86aeb1733 100644
@@ -2045,6 +2045,7 @@ int db8500_prcmu_config_hotmon(u8 low, u8 high)
 
 	return 0;
 }
+EXPORT_SYMBOL_GPL(db8500_prcmu_config_hotmon);
 
 static int config_hot_period(u16 val)
 {
@@ -2071,11 +2072,13 @@ int db8500_prcmu_start_temp_sense(u16 cycles32k)
 
 	return config_hot_period(cycles32k);
 }
+EXPORT_SYMBOL_GPL(db8500_prcmu_start_temp_sense);
 
 int db8500_prcmu_stop_temp_sense(void)
 {
 	return config_hot_period(0xFFFF);
 }
+EXPORT_SYMBOL_GPL(db8500_prcmu_stop_temp_sense);
 
 static int prcmu_a9wdog(u8 cmd, u8 d0, u8 d1, u8 d2, u8 d3)
 {
drivers/thermal/Kconfig +2 -2
index 0852fd028dc9..7c92c09be213 100644
@@ -237,8 +237,8 @@ config DOVE_THERMAL
 	  framework.
 
 config DB8500_THERMAL
-	bool "DB8500 thermal management"
-	depends on ARCH_U8500
+	tristate "DB8500 thermal management"
+	depends on MFD_DB8500_PRCMU
 	default y
 	help
 	  Adds DB8500 thermal management implementation according to the thermal
Signature · 4 lines
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org ? Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
#5 lore raw

Re: [PATCH 3/3] thermal: allow u8500-thermal driver to be a module

Quoted 19 lines · Lee Jones
Quoted 8 lines · Arnd Bergmann

When the thermal subsystem is a loadable module, the u8500 driver fails to build:

drivers/thermal/built-in.o: In function `db8500_thermal_probe':
db8500_thermal.c:(.text+0x96c): undefined reference to thermal_zone_device_register' drivers/thermal/built-in.o: In function db8500_thermal_work':
db8500_thermal.c:(.text+0xab4): undefined reference to `thermal_zone_device_update'

Quoted 8 lines

This changes the symbol to a tristate, so Kconfig can track the dependency correctly.

---
 drivers/mfd/db8500-prcmu.c | 3 +++
 drivers/thermal/Kconfig    | 4 ++--
 2 files changed, 5 insertions(+), 2 deletions(-)
Quoted 5 lines

As this touches a core Thermal file, I think it's better off going in via that tree. If that's a problem, I can take it with the relevant Acks.

Thanks, I am adding to linux-next to see how it goes.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20160209/3f8a8e06/attachment.sig>

Acked-by on v1 3/3
#6 lore raw

Re: [PATCH 3/3] thermal: allow u8500-thermal driver to be a module

In reply to Arnd Bergmann
Quoted 8 lines · Arnd Bergmann

When the thermal subsystem is a loadable module, the u8500 driver fails to build:

drivers/thermal/built-in.o: In function `db8500_thermal_probe':
db8500_thermal.c:(.text+0x96c): undefined reference to thermal_zone_device_register' drivers/thermal/built-in.o: In function db8500_thermal_work':
db8500_thermal.c:(.text+0xab4): undefined reference to `thermal_zone_device_update'

Quoted 4 lines

This changes the symbol to a tristate, so Kconfig can track the dependency correctly.

Yours,
Linus Walleij

#7 lore raw

cover randconfig warning fixes for thermal

In reply to Arnd Bergmann
Quoted 10 lines · Arnd Bergmann

These are three simple fixes for ARM randconfig builds:

[PATCH 1/3] thermal: spear: use __maybe_unused for PM functions [PATCH 2/3] thermal: allow spear-thermal driver to be a module [PATCH 3/3] thermal: allow u8500-thermal driver to be a module

All three bugs are on configurationsn that are not important and that rarely happen even with randconfig builds.

Arnd

Thanks a lot for your cleanups Arnd,
queueing all three.

Eduardo Valentin

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20160209/57f41a2f/attachment.sig>