fujitsu-laptop: Clear build warnings
Subsystems (2)
PATCH 2/2 fujitsu-laptop: Clear build warnings
When CONFIG_FUJITSU_LAPTOP_DEBUG is disabled and W=1, the fujitsu-laptop driver builds with the following warnings:
drivers/platform/x86/fujitsu-laptop.c: In function "bl_update_status":drivers/platform/x86/fujitsu-laptop.c:409:8: warning: suggest braces around empty body in an "if" statement [-Wempty-body]
ret);
^
drivers/platform/x86/fujitsu-laptop.c:418:8: warning: suggest braces around empty body in an "if" statement [-Wempty-body]
ret);
^Rework the debug printk helper macro to get rid of these. I verified that this change has no effect on the generated binary, both in the debug and non-debug case.
--- drivers/platform/x86/fujitsu-laptop.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)
drivers/platform/x86/fujitsu-laptop.c +4 -5
@@ -129,15 +129,14 @@#define FUJLAPTOP_DBG_INFO 0x0004#define FUJLAPTOP_DBG_TRACE 0x0008 -#define dbg_printk(a_dbg_level, format, arg...) \ +#ifdef CONFIG_FUJITSU_LAPTOP_DEBUG +#define vdbg_printk(a_dbg_level, format, arg...) \ do { if (dbg_level & a_dbg_level) \ printk(FUJLAPTOP_DEBUG "%s: " format, __func__ , ## arg); \ } while (0) -#ifdef CONFIG_FUJITSU_LAPTOP_DEBUG -#define vdbg_printk(a_dbg_level, format, arg...) \ - dbg_printk(a_dbg_level, format, ## arg)#else -#define vdbg_printk(a_dbg_level, format, arg...) +#define vdbg_printk(a_dbg_level, format, arg...) \ + do { } while (0)#endif /* Device controlling the backlight and associated keys */
Signature · 2 lines
Jean Delvare SUSE L3 Support
Looks reasonable to me - thanks.
Quoted 49 lines · Jean Delvare
When
CONFIG_FUJITSU_LAPTOP_DEBUGis disabled and W=1, the fujitsu-laptop driver builds with the following warnings:
drivers/platform/x86/fujitsu-laptop.c: In function "bl_update_status":drivers/platform/x86/fujitsu-laptop.c:409:8: warning: suggest braces around empty body in an "if" statement [-Wempty-body]ret); ^ drivers/platform/x86/fujitsu-laptop.c:418:8: warning: suggest braces around empty body in an "if" statement [-Wempty-body] ret); ^Rework the debug printk helper macro to get rid of these. I verified that this change has no effect on the generated binary, both in the debug and non-debug case.
Signed-off-by Jean Delvare <[email protected]>Cc Jonathan Woithe <[email protected]>Cc Matthew Garrett <[email protected]>--- drivers/platform/x86/fujitsu-laptop.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)drivers/platform/x86/fujitsu-laptop.c +4
-5@@ -129,15 +129,14 @@#define FUJLAPTOP_DBG_INFO 0x0004#define FUJLAPTOP_DBG_TRACE 0x0008 -#define dbg_printk(a_dbg_level, format, arg...) \ +#ifdef CONFIG_FUJITSU_LAPTOP_DEBUG +#define vdbg_printk(a_dbg_level, format, arg...) \ do { if (dbg_level & a_dbg_level) \ printk(FUJLAPTOP_DEBUG "%s: " format, __func__ , ## arg); \ } while (0) -#ifdef CONFIG_FUJITSU_LAPTOP_DEBUG -#define vdbg_printk(a_dbg_level, format, arg...) \ - dbg_printk(a_dbg_level, format, ## arg)#else -#define vdbg_printk(a_dbg_level, format, arg...) +#define vdbg_printk(a_dbg_level, format, arg...) \ + do { } while (0)#endif /* Device controlling the backlight and associated keys */ Signature · 3 lines
-- Jean Delvare SUSE L3 Support