[PATCH] x86, mc146818rtc.h: use do{}while(0) for emptylock_cmos()/unlock_cmos()

From: Jesper Juhl
Date: Sat Dec 17 2011 - 19:05:34 EST


gcc noticed (when using -Wempty-body) that our use of lock_cmos() and
unlock_cmos() in arch/x86/include/asm/mach_traps.h is potentially
problematic :

arch/x86/include/asm/mach_traps.h:32:15: warning: suggest braces around empty body in an ʽelseʼ statement [-Wempty-body]
arch/x86/include/asm/mach_traps.h:40:16: warning: suggest braces around empty body in an ʽelseʼ statement [-Wempty-body]

Let's just use the standard 'do {} while (0)' solution. That shuts up
gcc and also prevents future problems if the macros should end up
being used in a similar situation elsewhere.

Signed-off-by: Jesper Juhl <jj@xxxxxxxxxxxxx>
---
arch/x86/include/asm/mc146818rtc.h | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/include/asm/mc146818rtc.h b/arch/x86/include/asm/mc146818rtc.h
index 01fdf56..3bb1b14 100644
--- a/arch/x86/include/asm/mc146818rtc.h
+++ b/arch/x86/include/asm/mc146818rtc.h
@@ -81,8 +81,8 @@ static inline unsigned char current_lock_cmos_reg(void)
#else
#define lock_cmos_prefix(reg) do {} while (0)
#define lock_cmos_suffix(reg) do {} while (0)
-#define lock_cmos(reg)
-#define unlock_cmos()
+#define lock_cmos(reg) do {} while (0)
+#define unlock_cmos() do {} while (0)
#define do_i_have_lock_cmos() 0
#define current_lock_cmos_reg() 0
#endif
--
1.7.8

--
Jesper Juhl <jj@xxxxxxxxxxxxx> http://www.chaosbits.net/
Don't top-post http://www.catb.org/jargon/html/T/top-post.html
Plain text mails only, please.