Hi Tony,
Here are three patches to fix the remaining warnings I get
in OMAP randconfig builds. The problems are all harmless,
and the patches are just shutting up the compiler, but I
think it's still worthwhile to include them to reduce the
noise.
Arnd
The omap_generic_init() and omap_hwmod_init_postsetup() functions are
used in the initialization for all OMAP2+ SoC types, but in the
extreme case that those are all disabled, we get a warning about
unused code:
arch/arm/mach-omap2/io.c:412:123: error: 'omap_hwmod_init_postsetup' defined but not used [-Werror=unused-function]
arch/arm/mach-omap2/board-generic.c:30:123: error: 'omap_generic_init' defined but not used [-Werror=unused-function]
This annotates both as __maybe_unused to shut up that warning.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
arch/arm/mach-omap2/board-generic.c | 2 +-
arch/arm/mach-omap2/io.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
From: Tony Lindgren <tony@atomide.com> Date: 2016-02-23 16:07:16
* Arnd Bergmann [off-list ref] [160223 05:58]:
The omap_generic_init() and omap_hwmod_init_postsetup() functions are
used in the initialization for all OMAP2+ SoC types, but in the
extreme case that those are all disabled, we get a warning about
unused code:
arch/arm/mach-omap2/io.c:412:123: error: 'omap_hwmod_init_postsetup' defined but not used [-Werror=unused-function]
arch/arm/mach-omap2/board-generic.c:30:123: error: 'omap_generic_init' defined but not used [-Werror=unused-function]
This annotates both as __maybe_unused to shut up that warning.
Looks OK to me:
Acked-by: Tony Lindgren <tony@atomide.com>
The osk_mistral_init() contains code that is only compiled when
CONFIG_PM is set, but it uses a variable that is declared outside
of the #ifdef:
arch/arm/mach-omap1/board-osk.c: In function 'osk_mistral_init':
arch/arm/mach-omap1/board-osk.c:513:7: warning: unused variable 'ret' [-Wunused-variable]
This puts the variable in the same #ifdef to avoid the warning.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
arch/arm/mach-omap1/board-osk.c | 2 ++
1 file changed, 2 insertions(+)
From: Tony Lindgren <tony@atomide.com> Date: 2016-02-23 16:10:08
* Arnd Bergmann [off-list ref] [160223 05:58]:
quoted hunk
The osk_mistral_init() contains code that is only compiled when
CONFIG_PM is set, but it uses a variable that is declared outside
of the #ifdef:
arch/arm/mach-omap1/board-osk.c: In function 'osk_mistral_init':
arch/arm/mach-omap1/board-osk.c:513:7: warning: unused variable 'ret' [-Wunused-variable]
This puts the variable in the same #ifdef to avoid the warning.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
arch/arm/mach-omap1/board-osk.c | 2 ++
1 file changed, 2 insertions(+)
Let's just remove the #ifdef CONFIG_PM in osk_mistral_init()
instead. That's for the wake-up button and I'm not aware
of any other use cases for that button.
Regards,
Tony
From: Aaro Koskinen <aaro.koskinen@iki.fi> Date: 2016-02-23 23:40:19
On Tue, Feb 23, 2016 at 02:57:52PM +0100, Arnd Bergmann wrote:
The osk_mistral_init() contains code that is only compiled when
CONFIG_PM is set, but it uses a variable that is declared outside
of the #ifdef:
arch/arm/mach-omap1/board-osk.c: In function 'osk_mistral_init':
arch/arm/mach-omap1/board-osk.c:513:7: warning: unused variable 'ret' [-Wunused-variable]
This puts the variable in the same #ifdef to avoid the warning.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
The modem pm handler in the ams-delta board uses regulator_enable()
but does not check for a successful return code:
board-ams-delta.c:521:3: error: ignoring return value of 'regulator_enable', declared with attribute warn_unused_result [-Werror=unused-result]
It is not easy to propagate that return code to the callers in
uart_configure_port/uart_suspend_port/uart_resume_port, unless
we change all UART drivers, and it is unclear what those would
do with the return code.
Instead, this patch uses a runtime warning to replace the
compiletime warning. I have checked that the regulator in question
is hardcoded to a fixed-voltage GPIO regulator, and that should
never fail to get enabled if I understand the code right.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
arch/arm/mach-omap1/board-ams-delta.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
From: Tony Lindgren <tony@atomide.com> Date: 2016-02-23 16:10:39
* Arnd Bergmann [off-list ref] [160223 05:58]:
The modem pm handler in the ams-delta board uses regulator_enable()
but does not check for a successful return code:
board-ams-delta.c:521:3: error: ignoring return value of 'regulator_enable', declared with attribute warn_unused_result [-Werror=unused-result]
It is not easy to propagate that return code to the callers in
uart_configure_port/uart_suspend_port/uart_resume_port, unless
we change all UART drivers, and it is unclear what those would
do with the return code.
Instead, this patch uses a runtime warning to replace the
compiletime warning. I have checked that the regulator in question
is hardcoded to a fixed-voltage GPIO regulator, and that should
never fail to get enabled if I understand the code right.
Looks OK to me:
Acked-by: Tony Lindgren <tony@atomide.com>
From: One Thousand Gnomes <hidden> Date: 2016-02-23 16:16:09
quoted
It is not easy to propagate that return code to the callers in
uart_configure_port/uart_suspend_port/uart_resume_port, unless
we change all UART drivers, and it is unclear what those would
do with the return code.
Instead, this patch uses a runtime warning to replace the
compiletime warning. I have checked that the regulator in question
is hardcoded to a fixed-voltage GPIO regulator, and that should
never fail to get enabled if I understand the code right.
Looks OK to me:
If it was a concern for a real driver I think I'd perform a hangup on the
port at that moment. That's what happens if for example you hot unplug a
serial port which would be approximately the same as finding out you
can't power it back up.
Alan
From: Aaro Koskinen <aaro.koskinen@iki.fi> Date: 2016-02-23 23:40:48
On Tue, Feb 23, 2016 at 02:57:53PM +0100, Arnd Bergmann wrote:
The modem pm handler in the ams-delta board uses regulator_enable()
but does not check for a successful return code:
board-ams-delta.c:521:3: error: ignoring return value of 'regulator_enable', declared with attribute warn_unused_result [-Werror=unused-result]
It is not easy to propagate that return code to the callers in
uart_configure_port/uart_suspend_port/uart_resume_port, unless
we change all UART drivers, and it is unclear what those would
do with the return code.
Instead, this patch uses a runtime warning to replace the
compiletime warning. I have checked that the regulator in question
is hardcoded to a fixed-voltage GPIO regulator, and that should
never fail to get enabled if I understand the code right.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>