Skip to contentSkip to conversation

#define foo(a) do { ... } while; typo fix for 2.4.18-pre9-ac1

PATCH In review Timothy Ball 2 participants 2 messages Feb 13, 2002

Subsystems (15)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 #define foo(a) do { ... } while; typo fix for 2.4.18-pre9-ac1

Here is a patch for 2.4.18-pre9-ac1 that fixes the small do { ... } while(0); typo that may make some macros incorrectly parse. I've sent individual emails to several authors already and they have accepted it. But for completeness sake please apply this.

Some more of these meanies seemed to have snuck in, and I'm guess it has to do w/ some vm code... but anyways here's the fix.

--timball

--snip--snip--snip--

arch/ia64/kernel/perfmon.c +2 -2
diff -ruN linux/arch/ia64/kernel/perfmon.c linux-2.4-18-pre9-ac1.fixed/arch/ia64/kernel/perfmon.c
@@ -251,7 +251,7 @@
 #define DBprintk(a) \
 	do { \
 		if (pfm_debug >0) { printk(__FUNCTION__" %d: ", __LINE__); printk a; } \
-	} while (0);
+	} while (0)
 
 static void ia64_reset_pmu(void);
 
@@ -282,7 +282,7 @@
 /* 
  * helper macros
  */
-#define SET_PMU_OWNER(t)	do { pmu_owners[smp_processor_id()].owner = (t); } while(0);
+#define SET_PMU_OWNER(t)	do { pmu_owners[smp_processor_id()].owner = (t); } while(0)
 #define PMU_OWNER()		pmu_owners[smp_processor_id()].owner
 
 #ifdef CONFIG_SMP
arch/mips/kernel/signal.c +1 -1
diff -ruN linux/arch/mips/kernel/signal.c linux-2.4-18-pre9-ac1.fixed/arch/mips/kernel/signal.c
@@ -204,7 +204,7 @@
 #define restore_gp_reg(i) do {						\
 	err |= __get_user(reg, &sc->sc_regs[i]);			\
 	regs->regs[i] = reg;						\
-} while(0);
+} while(0)
 	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( 7); restore_gp_reg( 8); restore_gp_reg( 9);
arch/mips/sni/pci.c +1 -1
diff -ruN linux/arch/mips/sni/pci.c linux-2.4-18-pre9-ac1.fixed/arch/mips/sni/pci.c
@@ -25,7 +25,7 @@
 		 ((dev->bus->number    & 0xff) << 0x10) |                    \
 	         ((dev->devfn & 0xff) << 0x08) |                             \
 	         (where  & 0xfc);                                            \
-} while(0);
+} while(0)
 
 #if 0
 /* To do:  Bring this uptodate ...  */
arch/ppc/math-emu/op-4.h +1 -1
diff -ruN linux/arch/ppc/math-emu/op-4.h linux-2.4-18-pre9-ac1.fixed/arch/ppc/math-emu/op-4.h
@@ -279,7 +279,7 @@
     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[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)                               \
    do {                                                                 \
arch/sparc/mm/srmmu.c +1 -1
diff -ruN linux/arch/sparc/mm/srmmu.c linux-2.4-18-pre9-ac1.fixed/arch/sparc/mm/srmmu.c
@@ -1957,7 +1957,7 @@
 		iaddr = &(insn); \
 		daddr = &(dest); \
 		*iaddr = SPARC_BRANCH((unsigned long) daddr, (unsigned long) iaddr); \
-	} while(0);
+	} while(0)
 
 static void __init patch_window_trap_handlers(void)
 {
arch/sparc/mm/sun4c.c +1 -1
diff -ruN linux/arch/sparc/mm/sun4c.c linux-2.4-18-pre9-ac1.fixed/arch/sparc/mm/sun4c.c
@@ -425,7 +425,7 @@
 		daddr = &(dst);		\
 		iaddr = &(src);		\
 		*daddr = *iaddr;	\
-	} while (0);
+	} while (0)
 
 static void patch_kernel_fault_handler(void)
 {
arch/sparc64/kernel/binfmt_elf32.c +1 -1
diff -ruN linux/arch/sparc64/kernel/binfmt_elf32.c linux-2.4-18-pre9-ac1.fixed/arch/sparc64/kernel/binfmt_elf32.c
@@ -43,7 +43,7 @@
 	dest[34] = (unsigned int) src->tnpc;		\
 	dest[35] = src->y;				\
 	dest[36] = dest[37] = 0; /* XXX */		\
-} while(0);
+} while(0)
 
 typedef struct {
 	union {
drivers/char/applicom.c +1 -1
diff -ruN linux/drivers/char/applicom.c linux-2.4-18-pre9-ac1.fixed/drivers/char/applicom.c
@@ -36,7 +36,7 @@
 
 #if LINUX_VERSION_CODE < 0x20300 
 /* 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 DECLARE_WAIT_QUEUE_HEAD(x) struct wait_queue *x
 #define __setup(x,y) /* */
drivers/char/drm/i810_dma.c +1 -1
diff -ruN linux/drivers/char/drm/i810_dma.c linux-2.4-18-pre9-ac1.fixed/drivers/char/drm/i810_dma.c
@@ -74,7 +74,7 @@
 	*(volatile unsigned int *)(virt + outring) = n;			\
 	outring += 4;							\
 	outring &= ringmask;						\
-} while (0);
+} while (0)
 
 static inline void i810_print_status_page(drm_device_t *dev)
 {
drivers/char/drm-4.0/i810_dma.c +1 -1
diff -ruN linux/drivers/char/drm-4.0/i810_dma.c linux-2.4-18-pre9-ac1.fixed/drivers/char/drm-4.0/i810_dma.c
@@ -83,7 +83,7 @@
 	*(volatile unsigned int *)(virt + outring) = n;			\
 	outring += 4;							\
 	outring &= ringmask;						\
-} while (0);
+} while (0)
 
 static inline void i810_print_status_page(drm_device_t *dev)
 {
drivers/isdn/avmb1/kcapi.c +2 -2
diff -ruN linux/drivers/isdn/avmb1/kcapi.c linux-2.4-18-pre9-ac1.fixed/drivers/isdn/avmb1/kcapi.c
@@ -103,8 +103,8 @@
 #define APPL(a)		   (&applications[(a)-1])
 #define	VALID_APPLID(a)	   ((a) && (a) <= CAPI_MAXAPPL && APPL(a)->applid == a)
 #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_USED(a)  do{ APPL(a)->applid=(a); MOD_INC_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 NCCI2CTRL(ncci)    (((ncci) >> 24) & 0x7f)
 
drivers/mtd/ftl.c +1 -1
diff -ruN linux/drivers/mtd/ftl.c linux-2.4-18-pre9-ac1.fixed/drivers/mtd/ftl.c
@@ -87,7 +87,7 @@
 #define register_disk(dev, drive, minors, ops, size) \
     do { (dev)->part[(drive)*(minors)].nr_sects = size; \
         if (size == 0) (dev)->part[(drive)*(minors)].start_sect = -1; \
-        resetup_one_dev(dev, drive); } while (0);
+        resetup_one_dev(dev, drive); } while (0)
 #endif
 
 #if (LINUX_VERSION_CODE < 0x20320)
drivers/net/acenic.c +10 -10
diff -ruN linux/drivers/net/acenic.c linux-2.4-18-pre9-ac1.fixed/drivers/net/acenic.c
@@ -166,12 +166,12 @@
 #endif
 
 #ifndef SET_MODULE_OWNER
-#define SET_MODULE_OWNER(dev)		{do{} while(0);}
+#define SET_MODULE_OWNER(dev)		do { } while(0)
 #define ACE_MOD_INC_USE_COUNT		MOD_INC_USE_COUNT
 #define ACE_MOD_DEC_USE_COUNT		MOD_DEC_USE_COUNT
 #else
-#define ACE_MOD_INC_USE_COUNT		{do{} while(0);}
-#define ACE_MOD_DEC_USE_COUNT		{do{} while(0);}
+#define ACE_MOD_INC_USE_COUNT		do { } while(0)
+#define ACE_MOD_DEC_USE_COUNT		do { } while(0)
 #endif
 
 
@@ -252,7 +252,7 @@
 #define dev_kfree_skb_irq(a)			dev_kfree_skb(a)
 #define netif_wake_queue(dev)			clear_bit(0, &dev->tbusy)
 #define netif_stop_queue(dev)			set_bit(0, &dev->tbusy)
-#define late_stop_netif_stop_queue(dev)		{do{} while(0);}
+#define late_stop_netif_stop_queue(dev)		do { } while(0)
 #define early_stop_netif_stop_queue(dev)	test_and_set_bit(0,&dev->tbusy)
 #define early_stop_netif_wake_queue(dev)	netif_wake_queue(dev)
 
@@ -266,7 +266,7 @@
 #define ace_mark_net_bh()			mark_bh(NET_BH)
 #define netif_queue_stopped(dev)		dev->tbusy
 #define netif_running(dev)			dev->start
-#define ace_if_down(dev)			{do{dev->start = 0;} while(0);}
+#define ace_if_down(dev)			do { dev->start = 0; } while(0)
 
 #define tasklet_struct				tq_struct
 static inline void tasklet_schedule(struct tasklet_struct *tasklet)
@@ -284,13 +284,13 @@
 	tasklet->routine = (void (*)(void *))func;
 	tasklet->data = (void *)data;
 }
-#define tasklet_kill(tasklet)			{do{} while(0);}
+#define tasklet_kill(tasklet)			do { } while(0)
 #else
 #define late_stop_netif_stop_queue(dev)		netif_stop_queue(dev)
 #define early_stop_netif_stop_queue(dev)	0
-#define early_stop_netif_wake_queue(dev)	{do{} while(0);}
-#define ace_mark_net_bh()			{do{} while(0);}
-#define ace_if_down(dev)			{do{} while(0);}
+#define early_stop_netif_wake_queue(dev)	do { } while(0)
+#define ace_mark_net_bh()			do { } while(0)
+#define ace_if_down(dev)			do { } while(0)
 #endif
 
 #if (LINUX_VERSION_CODE >= 0x02031b)
@@ -306,7 +306,7 @@
 
 #ifndef ARCH_HAS_PREFETCHW
 #ifndef prefetchw
-#define prefetchw(x)				{do{} while(0);}
+#define prefetchw(x)				do { } while(0)
 #endif
 #endif
 
drivers/net/at1700.c +1 -1
diff -ruN linux/drivers/net/at1700.c linux-2.4-18-pre9-ac1.fixed/drivers/net/at1700.c
@@ -464,7 +464,7 @@
 #define EE_DATA_READ	0x80	/* EEPROM chip data out, in reg. 17. */
 
 /* Delay between EEPROM clock transitions. */
-#define eeprom_delay()	do {} while (0);
+#define eeprom_delay()	do { } while (0)
 
 /* The EEPROM commands include the alway-set leading bit. */
 #define EE_WRITE_CMD	(5 << 6)
drivers/net/pppoe.c +4 -4
diff -ruN linux/drivers/net/pppoe.c linux-2.4-18-pre9-ac1.fixed/drivers/net/pppoe.c
@@ -86,11 +86,11 @@
 
 
 #if 0
-#define CHECKPTR(x,y) { if (!(x) && pppoe_debug &7 ){ printk(KERN_CRIT "PPPoE Invalid pointer : %s , %p\n",#x,(x)); error=-EINVAL; goto y; }}
-#define DEBUG(s,args...) if( pppoe_debug & (s) ) printk(KERN_CRIT args );
+#define CHECKPTR(x,y) do { if (!(x) && pppoe_debug &7 ){ printk(KERN_CRIT "PPPoE Invalid pointer : %s , %p\n",#x,(x)); error=-EINVAL; goto y; }} while (0)
+#define DEBUG(s,args...) do { if( pppoe_debug & (s) ) printk(KERN_CRIT args ); } while (0)
 #else
-#define CHECKPTR(x,y) do {} while (0);
-#define DEBUG(s,args...) do { } while (0);
+#define CHECKPTR(x,y) do { } while (0)
+#define DEBUG(s,args...) do { } while (0)
 #endif
 
 
drivers/net/rrunner.c +3 -3
diff -ruN linux/drivers/net/rrunner.c linux-2.4-18-pre9-ac1.fixed/drivers/net/rrunner.c
@@ -73,13 +73,13 @@
 #define rr_mark_net_bh(foo) mark_bh(foo)
 #define rr_if_busy(dev)     dev->tbusy
 #define rr_if_running(dev)  dev->start /* Currently unused. */
-#define rr_if_down(dev)     {do{dev->start = 0;}while (0);}
+#define rr_if_down(dev)     do { dev->start = 0; } while (0)
 #else
 #define NET_BH              0
-#define rr_mark_net_bh(foo) {do{} while(0);}
+#define rr_mark_net_bh(foo) do { } while(0)
 #define rr_if_busy(dev)     netif_queue_stopped(dev)
 #define rr_if_running(dev)  netif_running(dev)
-#define rr_if_down(dev)     {do{} while(0);}
+#define rr_if_down(dev)     do { } while(0)
 #endif
 
 #include "rrunner.h"
drivers/net/wan/lmc/lmc_var.h +1 -1
diff -ruN linux/drivers/net/wan/lmc/lmc_var.h linux-2.4-18-pre9-ac1.fixed/drivers/net/wan/lmc/lmc_var.h
@@ -87,7 +87,7 @@
 		lmc_delay(); \
 		LMC_CSR_WRITE((sc), csr_9, 0x30000); \
                 lmc_delay(); \
-		n--; }} while(0);
+		n--; }} while(0)
 
 struct lmc_regfile_t {
     lmc_csrptr_t csr_busmode;                  /* CSR0 */
drivers/s390/block/dasd_int.h +4 -4
diff -ruN linux/drivers/s390/block/dasd_int.h linux-2.4-18-pre9-ac1.fixed/drivers/s390/block/dasd_int.h
@@ -203,14 +203,14 @@
         debug_sprintf_event(d_device->debug_area,d_level,\
                     DASD_DEVICE_FORMAT_STRING d_str "\n",\
                     d_device, d_data);\
-} while(0);
+} while(0)
 #define DASD_DEVICE_DEBUG_EXCEPTION(d_level, d_device, d_str, d_data...)\
 do {\
         if ( d_device->debug_area != NULL )\
         debug_sprintf_exception(d_device->debug_area,d_level,\
                         DASD_DEVICE_FORMAT_STRING d_str "\n",\
                         d_device, d_data);\
-} while(0);
+} while(0)
 
 #define DASD_DRIVER_FORMAT_STRING "Driver: <[%p]>"
 #define DASD_DRIVER_DEBUG_EVENT(d_level, d_fn, d_str, d_data...)\
@@ -219,14 +219,14 @@
         debug_sprintf_event(dasd_debug_area, d_level,\
                     DASD_DRIVER_FORMAT_STRING #d_fn ":" d_str "\n",\
                     d_fn, d_data);\
-} while(0);
+} while(0)
 #define DASD_DRIVER_DEBUG_EXCEPTION(d_level, d_fn, d_str, d_data...)\
 do {\
         if ( dasd_debug_area != NULL )\
         debug_sprintf_exception(dasd_debug_area, d_level,\
                         DASD_DRIVER_FORMAT_STRING #d_fn ":" d_str "\n",\
                         d_fn, d_data);\
-} while(0);
+} while(0)
 
 struct dasd_device_t;
 struct request;
drivers/scsi/3w-xxxx.h +1 -1
diff -ruN linux/drivers/scsi/3w-xxxx.h linux-2.4-18-pre9-ac1.fixed/drivers/scsi/3w-xxxx.h
@@ -213,7 +213,7 @@
 #ifdef TW_DEBUG
 #define dprintk(msg...) printk(msg)
 #else
-#define dprintk(msg...) do { } while(0);
+#define dprintk(msg...) do { } while(0)
 #endif
 
 /* Scatter Gather List Entry */
drivers/telephony/ixj.c +1 -1
diff -ruN linux/drivers/telephony/ixj.c linux-2.4-18-pre9-ac1.fixed/drivers/telephony/ixj.c
@@ -387,7 +387,7 @@
 #ifdef PERFMON_STATS
 #define ixj_perfmon(x)	((x)++)
 #else
-#define ixj_perfmon(x)	do {} while(0);
+#define ixj_perfmon(x)	do { } while(0)
 #endif
 
 static int ixj_convert_loaded;
drivers/video/chipsfb.c +1 -1
diff -ruN linux/drivers/video/chipsfb.c linux-2.4-18-pre9-ac1.fixed/drivers/video/chipsfb.c
@@ -79,7 +79,7 @@
 } while (0)
 #define read_ind(num, var, ap, dp)	do { \
 	outb((num), (ap)); var = inb((dp)); \
-} while (0);
+} while (0)
 
 /* extension registers */
 #define write_xr(num, val)	write_ind(num, val, 0x3d6, 0x3d7)
drivers/video/fbcon-cfb24.c +2 -2
diff -ruN linux/drivers/video/fbcon-cfb24.c linux-2.4-18-pre9-ac1.fixed/drivers/video/fbcon-cfb24.c
@@ -76,14 +76,14 @@
 	out1 = (in1<<8)  | (in2>>16); \
 	out2 = (in2<<16) | (in3>>8); \
 	out3 = (in3<<24) | in4; \
-    } while (0);
+    } while (0)
 #elif defined(__LITTLE_ENDIAN)
 #define convert4to3(in1, in2, in3, in4, out1, out2, out3) \
     do { \
 	out1 = in1       | (in2<<24); \
 	out2 = (in2>> 8) | (in3<<16); \
 	out3 = (in3>>16) | (in4<< 8); \
-    } while (0);
+    } while (0)
 #else
 #error FIXME: No endianness??
 #endif
drivers/video/virgefb.c +3 -5
diff -ruN linux/drivers/video/virgefb.c linux-2.4-18-pre9-ac1.fixed/drivers/video/virgefb.c
@@ -670,12 +670,10 @@
  */
 
 #define Cyber3D_WaitQueue(v) \
-{ \
-	 do { \
+	do { \
 		while ((rl_3d(0x8504) & 0x1f00) < (((v)+2) << 8)); \
-	 } \
-	while (0); \
-}
+	} \
+	while (0)
 
 static inline void Cyber3D_WaitBusy(void)
 {
fs/vfat/namei.c +1 -1
diff -ruN linux/fs/vfat/namei.c linux-2.4-18-pre9-ac1.fixed/fs/vfat/namei.c
@@ -446,7 +446,7 @@
 	(x)->lower = 1;				\
 	(x)->upper = 1;				\
 	(x)->valid = 1;				\
-} while (0);
+} while (0)
 
 static inline unsigned char
 shortname_info_to_lcase(struct shortname_info *base,
include/asm-arm/arch-cl7500/system.h +1 -1
diff -ruN linux/include/asm-arm/arch-cl7500/system.h linux-2.4-18-pre9-ac1.fixed/include/asm-arm/arch-cl7500/system.h
@@ -18,6 +18,6 @@
 	do {					\
 		iomd_writeb(0, IOMD_ROMCR0);	\
 		cpu_reset(0);			\
-	} while (0);
+	} while (0)
 
 #endif
include/asm-arm/arch-sa1100/keyboard.h +2 -2
diff -ruN linux/include/asm-arm/arch-sa1100/keyboard.h linux-2.4-18-pre9-ac1.fixed/include/asm-arm/arch-sa1100/keyboard.h
@@ -10,8 +10,8 @@
 #include <asm/mach-types.h>
 #include <asm/arch/assabet.h>
 
-#define kbd_disable_irq()	do { } while(0);
-#define kbd_enable_irq()	do { } while(0);
+#define kbd_disable_irq()	do { } while(0)
+#define kbd_enable_irq()	do { } while(0)
 
 extern void sa1111_kbd_init_hw(void);
 extern void gc_kbd_init_hw(void);
include/asm-mips/spinlock.h +2 -2
diff -ruN linux/include/asm-mips/spinlock.h linux-2.4-18-pre9-ac1.fixed/include/asm-mips/spinlock.h
@@ -19,10 +19,10 @@
 
 #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_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
include/asm-mips64/spinlock.h +2 -2
diff -ruN linux/include/asm-mips64/spinlock.h linux-2.4-18-pre9-ac1.fixed/include/asm-mips64/spinlock.h
@@ -19,10 +19,10 @@
 
 #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_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
include/asm-parisc/pgalloc.h +1 -1
diff -ruN linux/include/asm-parisc/pgalloc.h linux-2.4-18-pre9-ac1.fixed/include/asm-parisc/pgalloc.h
@@ -120,7 +120,7 @@
 #define flush_tlb() do { \
         flush_data_tlb(); \
 	flush_instruction_tlb(); \
-} while(0);
+} while(0)
 
 #define flush_tlb_all() 	flush_tlb()	/* XXX p[id]tlb */
 
include/asm-sparc/elf.h +1 -1
diff -ruN linux/include/asm-sparc/elf.h linux-2.4-18-pre9-ac1.fixed/include/asm-sparc/elf.h
@@ -41,7 +41,7 @@
 	dest[34] = src->npc;				\
 	dest[35] = src->y;				\
 	dest[36] = dest[37] = 0; /* XXX */		\
-} while(0);
+} while(0)
 
 typedef struct {
 	union {
include/linux/mtd/compatmac.h +2 -2
diff -ruN linux/include/linux/mtd/compatmac.h linux-2.4-18-pre9-ac1.fixed/include/linux/mtd/compatmac.h
@@ -190,8 +190,8 @@
 
 #if LINUX_VERSION_CODE < 0x20300
 #include <linux/interrupt.h>
-#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_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)
 #else
 #include <asm/softirq.h>
 #include <linux/spinlock.h>
include/linux/rtnetlink.h +1 -1
diff -ruN linux/include/linux/rtnetlink.h linux-2.4-18-pre9-ac1.fixed/include/linux/rtnetlink.h
@@ -587,7 +587,7 @@
 
 #define ASSERT_RTNL() do { if (down_trylock(&rtnl_sem) == 0)  { up(&rtnl_sem); \
 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__); }
 
 
include/math-emu/op-4.h +1 -1
diff -ruN linux/include/math-emu/op-4.h linux-2.4-18-pre9-ac1.fixed/include/math-emu/op-4.h
@@ -645,7 +645,7 @@
     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[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)				\
    do {									\
include/net/sock.h +1 -1
diff -ruN linux/include/net/sock.h linux-2.4-18-pre9-ac1.fixed/include/net/sock.h
@@ -484,7 +484,7 @@
 do {	spin_lock_init(&((__sk)->lock.slock)); \
 	(__sk)->lock.users = 0; \
 	init_waitqueue_head(&((__sk)->lock.wq)); \
-} while(0);
+} while(0)
 
 struct sock {
 	/* Socket demultiplex comparisons on incoming packets. */
include/net/tcp.h +1 -1
diff -ruN linux/include/net/tcp.h linux-2.4-18-pre9-ac1.fixed/include/net/tcp.h
@@ -1825,6 +1825,6 @@
 	return 1;
 }
 
-#define TCP_CHECK_TIMER(sk) do { } while (0);
+#define TCP_CHECK_TIMER(sk) do { } while (0)
 
 #endif	/* _TCP_H */
net/ipv4/netfilter/ip_fw_compat_redir.c +1 -1
diff -ruN linux/net/ipv4/netfilter/ip_fw_compat_redir.c linux-2.4-18-pre9-ac1.fixed/net/ipv4/netfilter/ip_fw_compat_redir.c
@@ -43,7 +43,7 @@
 		   netplay... */					 \
 		printk("ASSERT: %s:%i(%s)\n",				 \
 		       __FILE__, __LINE__, __FUNCTION__);		 \
-} while(0);
+} while(0)
 #else
 #define IP_NF_ASSERT(x)
 #endif
net/ipv4/netfilter/ip_queue.c +1 -1
diff -ruN linux/net/ipv4/netfilter/ip_queue.c linux-2.4-18-pre9-ac1.fixed/net/ipv4/netfilter/ip_queue.c
@@ -464,7 +464,7 @@
 	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)
 {
net/ipv4/netfilter/ipt_ULOG.c +1 -1
diff -ruN linux/net/ipv4/netfilter/ipt_ULOG.c linux-2.4-18-pre9-ac1.fixed/net/ipv4/netfilter/ipt_ULOG.c
@@ -61,7 +61,7 @@
 #define DEBUGP(format, args...)
 #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 <[email protected]>");
 MODULE_DESCRIPTION("IP tables userspace logging module");
net/ipv6/netfilter/ip6_queue.c +1 -1
diff -ruN linux/net/ipv6/netfilter/ip6_queue.c linux-2.4-18-pre9-ac1.fixed/net/ipv6/netfilter/ip6_queue.c
@@ -518,7 +518,7 @@
 	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)
 {
Signature · 3 lines
	GPG key available on pgpkeys.mit.edu
pub  1024D/511FBD54 2001-07-23 Timothy Lu Hu Ball <[email protected]>
Key fingerprint = B579 29B0 F6C8 C7AA 3840  E053 FE02 BB97 511F BD54
#1 lore raw

QN: Usage and purpose of file leases (F_SETLEASE, F_GETLEASE)

Gidday,

I've had a look through various LK archives, and elsewhere, and read the sources, and there seems to be no documentation to be found on Linux file leases (as set by fcntl(fd, F_SETLEASE, lease-type)).

My question(s): what are file leases, what applications currently use them, and what are they used for?

After reading the relevant sources and doing a done a bit of experimentation, I can see that setting a lease can allow one process to find out if another process opens or truncates a specified file, through the generation of a SIGIO signal. That picture is very sketchy (e.g., there is some system for downgrading a write lease to a read lease after a certain timeout interval, but I haven't nailed down the details), and probably incomplete - can anyone fill it out, or point me to documentation on file leases.

Ultimately, I'd like to add material on file leases to the fcntl() man page.

Cheers

Michael