Commit c398fde6 authored by Dave Jones's avatar Dave Jones

[PATCH] Fix up broken do while macros.

parent 870b38b0
...@@ -204,7 +204,7 @@ restore_sigcontext(struct pt_regs *regs, struct sigcontext *sc) ...@@ -204,7 +204,7 @@ restore_sigcontext(struct pt_regs *regs, struct sigcontext *sc)
#define restore_gp_reg(i) do { \ #define restore_gp_reg(i) do { \
err |= __get_user(reg, &sc->sc_regs[i]); \ err |= __get_user(reg, &sc->sc_regs[i]); \
regs->regs[i] = reg; \ regs->regs[i] = reg; \
} while(0); } while(0)
restore_gp_reg( 1); restore_gp_reg( 2); restore_gp_reg( 3); restore_gp_reg( 1); restore_gp_reg( 2); restore_gp_reg( 3);
restore_gp_reg( 4); restore_gp_reg( 5); restore_gp_reg( 6); restore_gp_reg( 4); restore_gp_reg( 5); restore_gp_reg( 6);
restore_gp_reg( 7); restore_gp_reg( 8); restore_gp_reg( 9); restore_gp_reg( 7); restore_gp_reg( 8); restore_gp_reg( 9);
......
...@@ -25,7 +25,7 @@ do { \ ...@@ -25,7 +25,7 @@ do { \
((dev->bus->number & 0xff) << 0x10) | \ ((dev->bus->number & 0xff) << 0x10) | \
((dev->devfn & 0xff) << 0x08) | \ ((dev->devfn & 0xff) << 0x08) | \
(where & 0xfc); \ (where & 0xfc); \
} while(0); } while(0)
#if 0 #if 0
/* To do: Bring this uptodate ... */ /* To do: Bring this uptodate ... */
......
...@@ -279,7 +279,7 @@ ...@@ -279,7 +279,7 @@
X##_f[1] = (rsize <= _FP_W_TYPE_SIZE ? 0 : r >> _FP_W_TYPE_SIZE); \ X##_f[1] = (rsize <= _FP_W_TYPE_SIZE ? 0 : r >> _FP_W_TYPE_SIZE); \
X##_f[2] = (rsize <= 2*_FP_W_TYPE_SIZE ? 0 : r >> 2*_FP_W_TYPE_SIZE); \ X##_f[2] = (rsize <= 2*_FP_W_TYPE_SIZE ? 0 : r >> 2*_FP_W_TYPE_SIZE); \
X##_f[3] = (rsize <= 3*_FP_W_TYPE_SIZE ? 0 : r >> 3*_FP_W_TYPE_SIZE); \ X##_f[3] = (rsize <= 3*_FP_W_TYPE_SIZE ? 0 : r >> 3*_FP_W_TYPE_SIZE); \
} while (0); } while (0)
#define _FP_FRAC_CONV_4_1(dfs, sfs, D, S) \ #define _FP_FRAC_CONV_4_1(dfs, sfs, D, S) \
do { \ do { \
......
...@@ -1963,7 +1963,7 @@ extern unsigned long srmmu_fault; ...@@ -1963,7 +1963,7 @@ extern unsigned long srmmu_fault;
iaddr = &(insn); \ iaddr = &(insn); \
daddr = &(dest); \ daddr = &(dest); \
*iaddr = SPARC_BRANCH((unsigned long) daddr, (unsigned long) iaddr); \ *iaddr = SPARC_BRANCH((unsigned long) daddr, (unsigned long) iaddr); \
} while(0); } while(0)
static void __init patch_window_trap_handlers(void) static void __init patch_window_trap_handlers(void)
{ {
......
...@@ -425,7 +425,7 @@ extern unsigned long vac_hwflush_patch2, vac_hwflush_patch2_on; ...@@ -425,7 +425,7 @@ extern unsigned long vac_hwflush_patch2, vac_hwflush_patch2_on;
daddr = &(dst); \ daddr = &(dst); \
iaddr = &(src); \ iaddr = &(src); \
*daddr = *iaddr; \ *daddr = *iaddr; \
} while (0); } while (0)
static void patch_kernel_fault_handler(void) static void patch_kernel_fault_handler(void)
{ {
......
...@@ -43,7 +43,7 @@ do { unsigned int *dest = &(__elf_regs[0]); \ ...@@ -43,7 +43,7 @@ do { unsigned int *dest = &(__elf_regs[0]); \
dest[34] = (unsigned int) src->tnpc; \ dest[34] = (unsigned int) src->tnpc; \
dest[35] = src->y; \ dest[35] = src->y; \
dest[36] = dest[37] = 0; /* XXX */ \ dest[36] = dest[37] = 0; /* XXX */ \
} while(0); } while(0)
typedef struct { typedef struct {
union { union {
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
#if LINUX_VERSION_CODE < 0x20300 #if LINUX_VERSION_CODE < 0x20300
/* These probably want adding to <linux/compatmac.h> */ /* These probably want adding to <linux/compatmac.h> */
#define init_waitqueue_head(x) do { *(x) = NULL; } while (0); #define init_waitqueue_head(x) do { *(x) = NULL; } while (0)
#define PCI_BASE_ADDRESS(dev) (dev->base_address[0]) #define PCI_BASE_ADDRESS(dev) (dev->base_address[0])
#define DECLARE_WAIT_QUEUE_HEAD(x) struct wait_queue *x #define DECLARE_WAIT_QUEUE_HEAD(x) struct wait_queue *x
#define __setup(x,y) /* */ #define __setup(x,y) /* */
......
...@@ -73,7 +73,7 @@ ...@@ -73,7 +73,7 @@
*(volatile unsigned int *)(virt + outring) = n; \ *(volatile unsigned int *)(virt + outring) = n; \
outring += 4; \ outring += 4; \
outring &= ringmask; \ outring &= ringmask; \
} while (0); } while (0)
static inline void i810_print_status_page(drm_device_t *dev) static inline void i810_print_status_page(drm_device_t *dev)
{ {
......
...@@ -102,8 +102,8 @@ static char capi_manufakturer[64] = "AVM Berlin"; ...@@ -102,8 +102,8 @@ static char capi_manufakturer[64] = "AVM Berlin";
#define APPL(a) (&applications[(a)-1]) #define APPL(a) (&applications[(a)-1])
#define VALID_APPLID(a) ((a) && (a) <= CAPI_MAXAPPL && APPL(a)->applid == a) #define VALID_APPLID(a) ((a) && (a) <= CAPI_MAXAPPL && APPL(a)->applid == a)
#define APPL_IS_FREE(a) (APPL(a)->applid == 0) #define APPL_IS_FREE(a) (APPL(a)->applid == 0)
#define APPL_MARK_FREE(a) do{ APPL(a)->applid=0; MOD_DEC_USE_COUNT; }while(0); #define APPL_MARK_FREE(a) do{ APPL(a)->applid=0; MOD_DEC_USE_COUNT; }while(0)
#define APPL_MARK_USED(a) do{ APPL(a)->applid=(a); MOD_INC_USE_COUNT; }while(0); #define APPL_MARK_USED(a) do{ APPL(a)->applid=(a); MOD_INC_USE_COUNT; }while(0)
#define NCCI2CTRL(ncci) (((ncci) >> 24) & 0x7f) #define NCCI2CTRL(ncci) (((ncci) >> 24) & 0x7f)
......
...@@ -201,14 +201,14 @@ do {\ ...@@ -201,14 +201,14 @@ do {\
debug_sprintf_event(d_device->debug_area,d_level,\ debug_sprintf_event(d_device->debug_area,d_level,\
DASD_DEVICE_FORMAT_STRING d_str "\n",\ DASD_DEVICE_FORMAT_STRING d_str "\n",\
d_device, d_data);\ d_device, d_data);\
} while(0); } while(0)
#define DASD_DEVICE_DEBUG_EXCEPTION(d_level, d_device, d_str, d_data...)\ #define DASD_DEVICE_DEBUG_EXCEPTION(d_level, d_device, d_str, d_data...)\
do {\ do {\
if ( d_device->debug_area != NULL )\ if ( d_device->debug_area != NULL )\
debug_sprintf_exception(d_device->debug_area,d_level,\ debug_sprintf_exception(d_device->debug_area,d_level,\
DASD_DEVICE_FORMAT_STRING d_str "\n",\ DASD_DEVICE_FORMAT_STRING d_str "\n",\
d_device, d_data);\ d_device, d_data);\
} while(0); } while(0)
#define DASD_DRIVER_FORMAT_STRING "Driver: <[%p]>" #define DASD_DRIVER_FORMAT_STRING "Driver: <[%p]>"
#define DASD_DRIVER_DEBUG_EVENT(d_level, d_fn, d_str, d_data...)\ #define DASD_DRIVER_DEBUG_EVENT(d_level, d_fn, d_str, d_data...)\
...@@ -217,14 +217,14 @@ do {\ ...@@ -217,14 +217,14 @@ do {\
debug_sprintf_event(dasd_debug_area, d_level,\ debug_sprintf_event(dasd_debug_area, d_level,\
DASD_DRIVER_FORMAT_STRING #d_fn ":" d_str "\n",\ DASD_DRIVER_FORMAT_STRING #d_fn ":" d_str "\n",\
d_fn, d_data);\ d_fn, d_data);\
} while(0); } while(0)
#define DASD_DRIVER_DEBUG_EXCEPTION(d_level, d_fn, d_str, d_data...)\ #define DASD_DRIVER_DEBUG_EXCEPTION(d_level, d_fn, d_str, d_data...)\
do {\ do {\
if ( dasd_debug_area != NULL )\ if ( dasd_debug_area != NULL )\
debug_sprintf_exception(dasd_debug_area, d_level,\ debug_sprintf_exception(dasd_debug_area, d_level,\
DASD_DRIVER_FORMAT_STRING #d_fn ":" d_str "\n",\ DASD_DRIVER_FORMAT_STRING #d_fn ":" d_str "\n",\
d_fn, d_data);\ d_fn, d_data);\
} while(0); } while(0)
struct dasd_device_t; struct dasd_device_t;
struct request; struct request;
......
...@@ -18,6 +18,6 @@ static void arch_idle(void) ...@@ -18,6 +18,6 @@ static void arch_idle(void)
do { \ do { \
iomd_writeb(0, IOMD_ROMCR0); \ iomd_writeb(0, IOMD_ROMCR0); \
cpu_reset(0); \ cpu_reset(0); \
} while (0); } while (0)
#endif #endif
...@@ -10,8 +10,8 @@ ...@@ -10,8 +10,8 @@
#include <asm/mach-types.h> #include <asm/mach-types.h>
#include <asm/arch/assabet.h> #include <asm/arch/assabet.h>
#define kbd_disable_irq() do { } while(0); #define kbd_disable_irq() do { } while(0)
#define kbd_enable_irq() do { } while(0); #define kbd_enable_irq() do { } while(0)
extern int sa1111_kbd_init_hw(void); extern int sa1111_kbd_init_hw(void);
extern void gc_kbd_init_hw(void); extern void gc_kbd_init_hw(void);
......
...@@ -19,10 +19,10 @@ typedef struct { ...@@ -19,10 +19,10 @@ typedef struct {
#define SPIN_LOCK_UNLOCKED (spinlock_t) { 0 } #define SPIN_LOCK_UNLOCKED (spinlock_t) { 0 }
#define spin_lock_init(x) do { (x)->lock = 0; } while(0); #define spin_lock_init(x) do { (x)->lock = 0; } while(0)
#define spin_is_locked(x) ((x)->lock != 0) #define spin_is_locked(x) ((x)->lock != 0)
#define spin_unlock_wait(x) ({ do { barrier(); } while ((x)->lock); }) #define spin_unlock_wait(x) do { barrier(); } while ((x)->lock)
/* /*
* Simple spin lock operations. There are two variants, one clears IRQ's * Simple spin lock operations. There are two variants, one clears IRQ's
......
...@@ -19,10 +19,10 @@ typedef struct { ...@@ -19,10 +19,10 @@ typedef struct {
#define SPIN_LOCK_UNLOCKED (spinlock_t) { 0 } #define SPIN_LOCK_UNLOCKED (spinlock_t) { 0 }
#define spin_lock_init(x) do { (x)->lock = 0; } while(0); #define spin_lock_init(x) do { (x)->lock = 0; } while(0)
#define spin_is_locked(x) ((x)->lock != 0) #define spin_is_locked(x) ((x)->lock != 0)
#define spin_unlock_wait(x) ({ do { barrier(); } while ((x)->lock); }) #define spin_unlock_wait(x) do { barrier(); } while ((x)->lock)
/* /*
* Simple spin lock operations. There are two variants, one clears IRQ's * Simple spin lock operations. There are two variants, one clears IRQ's
......
...@@ -123,7 +123,7 @@ extern void flush_instruction_tlb(void); ...@@ -123,7 +123,7 @@ extern void flush_instruction_tlb(void);
#define flush_tlb() do { \ #define flush_tlb() do { \
flush_data_tlb(); \ flush_data_tlb(); \
flush_instruction_tlb(); \ flush_instruction_tlb(); \
} while(0); } while(0)
#define flush_tlb_all() flush_tlb() /* XXX p[id]tlb */ #define flush_tlb_all() flush_tlb() /* XXX p[id]tlb */
......
...@@ -41,7 +41,7 @@ do { unsigned long *dest = &(__elf_regs[0]); \ ...@@ -41,7 +41,7 @@ do { unsigned long *dest = &(__elf_regs[0]); \
dest[34] = src->npc; \ dest[34] = src->npc; \
dest[35] = src->y; \ dest[35] = src->y; \
dest[36] = dest[37] = 0; /* XXX */ \ dest[36] = dest[37] = 0; /* XXX */ \
} while(0); } while(0)
typedef struct { typedef struct {
union { union {
......
...@@ -190,8 +190,8 @@ static inline int try_inc_mod_count(struct module *mod) ...@@ -190,8 +190,8 @@ static inline int try_inc_mod_count(struct module *mod)
#if LINUX_VERSION_CODE < 0x20300 #if LINUX_VERSION_CODE < 0x20300
#include <linux/interrupt.h> #include <linux/interrupt.h>
#define spin_lock_bh(lock) do {start_bh_atomic();spin_lock(lock);}while(0); #define spin_lock_bh(lock) do {start_bh_atomic();spin_lock(lock);} while(0)
#define spin_unlock_bh(lock) do {spin_unlock(lock);end_bh_atomic();}while(0); #define spin_unlock_bh(lock) do {spin_unlock(lock);end_bh_atomic();} while(0)
#else #else
#include <asm/softirq.h> #include <asm/softirq.h>
#include <linux/spinlock.h> #include <linux/spinlock.h>
......
...@@ -589,7 +589,7 @@ extern void rtnetlink_init(void); ...@@ -589,7 +589,7 @@ extern void rtnetlink_init(void);
#define ASSERT_RTNL() do { if (down_trylock(&rtnl_sem) == 0) { up(&rtnl_sem); \ #define ASSERT_RTNL() do { if (down_trylock(&rtnl_sem) == 0) { up(&rtnl_sem); \
printk("RTNL: assertion failed at " __FILE__ "(%d)\n", __LINE__); } \ printk("RTNL: assertion failed at " __FILE__ "(%d)\n", __LINE__); } \
} while(0); } while(0)
#define BUG_TRAP(x) if (!(x)) { printk("KERNEL: assertion (" #x ") failed at " __FILE__ "(%d)\n", __LINE__); } #define BUG_TRAP(x) if (!(x)) { printk("KERNEL: assertion (" #x ") failed at " __FILE__ "(%d)\n", __LINE__); }
......
...@@ -80,7 +80,7 @@ typedef struct { ...@@ -80,7 +80,7 @@ typedef struct {
do { spin_lock_init(&((__sk)->lock.slock)); \ do { spin_lock_init(&((__sk)->lock.slock)); \
(__sk)->lock.users = 0; \ (__sk)->lock.users = 0; \
init_waitqueue_head(&((__sk)->lock.wq)); \ init_waitqueue_head(&((__sk)->lock.wq)); \
} while(0); } while(0)
struct sock { struct sock {
/* Begin of struct sock/struct tcp_tw_bucket shared layout */ /* Begin of struct sock/struct tcp_tw_bucket shared layout */
......
...@@ -1832,6 +1832,6 @@ static inline int tcp_paws_check(struct tcp_opt *tp, int rst) ...@@ -1832,6 +1832,6 @@ static inline int tcp_paws_check(struct tcp_opt *tp, int rst)
return 1; return 1;
} }
#define TCP_CHECK_TIMER(sk) do { } while (0); #define TCP_CHECK_TIMER(sk) do { } while (0)
#endif /* _TCP_H */ #endif /* _TCP_H */
...@@ -43,7 +43,7 @@ do { \ ...@@ -43,7 +43,7 @@ do { \
netplay... */ \ netplay... */ \
printk("ASSERT: %s:%i(%s)\n", \ printk("ASSERT: %s:%i(%s)\n", \
__FILE__, __LINE__, __FUNCTION__); \ __FILE__, __LINE__, __FUNCTION__); \
} while(0); } while(0)
#else #else
#define IP_NF_ASSERT(x) #define IP_NF_ASSERT(x)
#endif #endif
......
...@@ -464,7 +464,7 @@ static int netlink_send_peer(ipq_queue_element_t *e) ...@@ -464,7 +464,7 @@ static int netlink_send_peer(ipq_queue_element_t *e)
return netlink_unicast(nfnl, skb, nlq->peer.pid, MSG_DONTWAIT); return netlink_unicast(nfnl, skb, nlq->peer.pid, MSG_DONTWAIT);
} }
#define RCV_SKB_FAIL(err) do { netlink_ack(skb, nlh, (err)); return; } while (0); #define RCV_SKB_FAIL(err) do { netlink_ack(skb, nlh, (err)); return; } while (0)
static __inline__ void netlink_receive_user_skb(struct sk_buff *skb) static __inline__ void netlink_receive_user_skb(struct sk_buff *skb)
{ {
......
...@@ -61,7 +61,7 @@ MODULE_LICENSE("GPL"); ...@@ -61,7 +61,7 @@ MODULE_LICENSE("GPL");
#define DEBUGP(format, args...) #define DEBUGP(format, args...)
#endif #endif
#define PRINTR(format, args...) do { if (net_ratelimit()) printk(format, ## args); } while (0); #define PRINTR(format, args...) do { if (net_ratelimit()) printk(format, ## args); } while (0)
MODULE_AUTHOR("Harald Welte <laforge@gnumonks.org>"); MODULE_AUTHOR("Harald Welte <laforge@gnumonks.org>");
MODULE_DESCRIPTION("IP tables userspace logging module"); MODULE_DESCRIPTION("IP tables userspace logging module");
......
...@@ -518,7 +518,7 @@ static int netlink_send_peer(ip6q_queue_element_t *e) ...@@ -518,7 +518,7 @@ static int netlink_send_peer(ip6q_queue_element_t *e)
return netlink_unicast(nfnl, skb, nlq6->peer.pid, MSG_DONTWAIT); return netlink_unicast(nfnl, skb, nlq6->peer.pid, MSG_DONTWAIT);
} }
#define RCV_SKB_FAIL(err) do { netlink_ack(skb, nlh, (err)); return; } while (0); #define RCV_SKB_FAIL(err) do { netlink_ack(skb, nlh, (err)); return; } while (0)
static __inline__ void netlink_receive_user_skb(struct sk_buff *skb) static __inline__ void netlink_receive_user_skb(struct sk_buff *skb)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment