randconfig warning fixes for thermal
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
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
@@ -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
PATCH 2/3 thermal: allow spear-thermal driver to be a module
In reply to Arnd BergmannWhen 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
@@ -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
PATCH 3/3 thermal: allow u8500-thermal driver to be a module
In reply to Arnd BergmannWhen 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
@@ -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
@@ -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
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 tothermal_zone_device_register' drivers/thermal/built-in.o: In functiondb8500_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
Kconfigcan track the dependency correctly.Signed-off-by Arnd Bergmann <[email protected]>--- 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@@ -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@@ -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
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 tothermal_zone_device_register' drivers/thermal/built-in.o: In functiondb8500_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
Kconfigcan track the dependency correctly.Signed-off-by Arnd Bergmann <[email protected]>--- 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.
Acked-by Lee Jones <[email protected]>
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>
Re: [PATCH 3/3] thermal: allow u8500-thermal driver to be a module
In reply to Arnd BergmannQuoted 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 tothermal_zone_device_register' drivers/thermal/built-in.o: In functiondb8500_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
Kconfigcan track the dependency correctly.Signed-off-by Arnd Bergmann <[email protected]>
Yours,
Linus Walleij
cover randconfig warning fixes for thermal
In reply to Arnd BergmannQuoted 10 lines · Arnd Bergmann
These are three simple fixes for ARM randconfig builds:
[PATCH 1/3] thermal: spear: use
__maybe_unusedfor 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 moduleAll 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>