Skip to contentSkip to conversation

#define foo(a) do { ... } while(0); typo fix

PATCH New Timothy Ball 1 participant 1 message Feb 11, 2002

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

PATCH 1/1 #define foo(a) do { ... } while(0); typo fix

Statements like the one in the subject shouldn't have the trailing semicolon, it's a minor typo and I only saw it four times in my egrep'ing so this following patch fixes it every where I saw it.

Please apply.

--timball

--snip--snip--snip--

drivers/video/chipsfb.c +1 -1
diff -ruN linux-2.4.18-pre1-mjc2.orig/drivers/video/chipsfb.c linux-2.4.18-pre1-mjc2/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)
fs/vfat/namei.c +1 -1
diff -ruN linux-2.4.18-pre1-mjc2.orig/fs/vfat/namei.c linux-2.4.18-pre1-mjc2/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/linux/mtd/compatmac.h +2 -2
diff -ruN linux-2.4.18-pre1-mjc2.orig/include/linux/mtd/compatmac.h linux-2.4.18-pre1-mjc2/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 -2
diff -ruN linux-2.4.18-pre1-mjc2.orig/include/linux/rtnetlink.h linux-2.4.18-pre1-mjc2/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):" __FUNCTION__ "\n", __LINE__); } \
-		   } while(0);
+		   } while(0)
 #define BUG_TRAP(x) if (!(x)) { printk("KERNEL: assertion (" #x ") failed at " __FILE__ "(%d):" __FUNCTION__ "\n", __LINE__); }
 
-- 

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