Commit 611aa19f authored by Stefan Richter's avatar Stefan Richter
Browse files

ieee1394: safer definition of empty macros



A deactivated macro, defined as "#define foo(bar)", will result in
silent corruption if somebody forgets a semicolon after a call to foo.
Replace it by "#define foo(bar) do {} while (0)" which will reveal any
respective syntax errors.

Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
parent 4b60912e
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -137,13 +137,13 @@
#if DV1394_DEBUG_LEVEL >= 2
#define irq_printk( args... ) printk( args )
#else
#define irq_printk( args... )
#define irq_printk( args... ) do {} while (0)
#endif

#if DV1394_DEBUG_LEVEL >= 1
#define debug_printk( args... ) printk( args)
#else
#define debug_printk( args... )
#define debug_printk( args... ) do {} while (0)
#endif

/* issue a dummy PCI read to force the preceding write
+1 −1
Original line number Diff line number Diff line
@@ -85,7 +85,7 @@ static void dump_packet(const char *text, quadlet_t *data, int size, int speed)
	printk("\n");
}
#else
#define dump_packet(a,b,c,d)
#define dump_packet(a,b,c,d) do {} while (0)
#endif

static void abort_requests(struct hpsb_host *host);
+1 −1
Original line number Diff line number Diff line
@@ -41,7 +41,7 @@ typedef u16 arm_length_t;
#define HPSB_VERBOSE(fmt, args...)	HPSB_PRINT(KERN_DEBUG, fmt , ## args)
#define HPSB_DEBUG_TLABELS
#else
#define HPSB_VERBOSE(fmt, args...)
#define HPSB_VERBOSE(fmt, args...)	do {} while (0)
#endif

#ifdef __BIG_ENDIAN
+4 −4
Original line number Diff line number Diff line
@@ -136,7 +136,7 @@
#define DBGMSG(fmt, args...) \
printk(KERN_INFO "%s: fw-host%d: " fmt "\n" , OHCI1394_DRIVER_NAME, ohci->host->id , ## args)
#else
#define DBGMSG(fmt, args...)
#define DBGMSG(fmt, args...) do {} while (0)
#endif

#ifdef CONFIG_IEEE1394_OHCI_DMA_DEBUG
@@ -148,8 +148,8 @@ printk(KERN_INFO "%s: fw-host%d: " fmt "\n" , OHCI1394_DRIVER_NAME, ohci->host->
		--global_outstanding_dmas, ## args)
static int global_outstanding_dmas = 0;
#else
#define OHCI_DMA_ALLOC(fmt, args...)
#define OHCI_DMA_FREE(fmt, args...)
#define OHCI_DMA_ALLOC(fmt, args...) do {} while (0)
#define OHCI_DMA_FREE(fmt, args...) do {} while (0)
#endif

/* print general (card independent) information */
@@ -210,7 +210,7 @@ static inline void packet_swab(quadlet_t *data, int tcode)
}
#else
/* Don't waste cycles on same sex byte swaps */
#define packet_swab(w,x)
#define packet_swab(w,x) do {} while (0)
#endif /* !LITTLE_ENDIAN */

/***********************************
+1 −1
Original line number Diff line number Diff line
@@ -67,7 +67,7 @@
#define DBGMSG(fmt, args...) \
printk(KERN_INFO "raw1394:" fmt "\n" , ## args)
#else
#define DBGMSG(fmt, args...)
#define DBGMSG(fmt, args...) do {} while (0)
#endif

static LIST_HEAD(host_info_list);
Loading