kern/83088: [patch] remove a few bogous semicolons
Antoine Brodin
antoine.brodin at laposte.net
Thu Jul 7 10:20:15 GMT 2005
>Number: 83088
>Category: kern
>Synopsis: [patch] remove a few bogous semicolons
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Thu Jul 07 10:20:14 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator: Antoine Brodin
>Release: FreeBSD 6.0-CURRENT i386
>Organization:
none
>Environment:
System: FreeBSD barton.dreadbsd.org 6.0-CURRENT FreeBSD 6.0-CURRENT #0: Wed Jul 6 21:48:13 CEST 2005 antoine at barton.dreadbsd.org:/usr/obj/usr/src/sys/BARTON i386
>Description:
The attached patch removes a few bogous semicolons at the end of the
definitions of do { ... } while (0) macros.
This could cause problems if the macros were used in if statements.
>How-To-Repeat:
>Fix:
--- while.diff begins here ---
Index: net/route.h
===================================================================
RCS file: /home/ncvs/src/sys/net/route.h,v
retrieving revision 1.63
diff -u -p -r1.63 route.h
--- net/route.h 7 Jan 2005 01:45:35 -0000 1.63
+++ net/route.h 7 Jul 2005 09:37:46 -0000
@@ -292,13 +292,13 @@ struct rt_addrinfo {
KASSERT((_rt)->rt_refcnt >= 0, \
("negative refcnt %ld", (_rt)->rt_refcnt)); \
(_rt)->rt_refcnt++; \
-} while (0);
+} while (0)
#define RT_REMREF(_rt) do { \
RT_LOCK_ASSERT(_rt); \
KASSERT((_rt)->rt_refcnt > 0, \
("bogus refcnt %ld", (_rt)->rt_refcnt)); \
(_rt)->rt_refcnt--; \
-} while (0);
+} while (0)
#define RTFREE_LOCKED(_rt) do { \
if ((_rt)->rt_refcnt <= 1) \
Index: sys/filedesc.h
===================================================================
RCS file: /home/ncvs/src/sys/sys/filedesc.h,v
retrieving revision 1.72
diff -u -p -r1.72 filedesc.h
--- sys/filedesc.h 10 Feb 2005 12:27:58 -0000 1.72
+++ sys/filedesc.h 7 Jul 2005 09:37:19 -0000
@@ -105,7 +105,7 @@ struct filedesc_to_leader {
(fd)->fd_locked = 2; \
(fd)->fd_wanted--; \
mtx_unlock(&(fd)->fd_mtx); \
- } while (0);
+ } while (0)
#define FILEDESC_UNLOCK(fd) \
do { \
@@ -116,7 +116,7 @@ struct filedesc_to_leader {
if ((fd)->fd_wanted) \
wakeup(&(fd)->fd_locked); \
mtx_unlock(&(fd)->fd_mtx); \
- } while (0);
+ } while (0)
#define FILEDESC_LOCK_FAST(fd) \
do { \
@@ -126,7 +126,7 @@ struct filedesc_to_leader {
msleep(&(fd)->fd_locked, &(fd)->fd_mtx, PLOCK, "fdesc", 0); \
(fd)->fd_locked = 1; \
(fd)->fd_wanted--; \
- } while (0);
+ } while (0)
#define FILEDESC_UNLOCK_FAST(fd) \
do { \
@@ -136,7 +136,7 @@ struct filedesc_to_leader {
if ((fd)->fd_wanted) \
wakeup(&(fd)->fd_locked); \
mtx_unlock(&(fd)->fd_mtx); \
- } while (0);
+ } while (0)
#ifdef INVARIANT_SUPPORT
#define FILEDESC_LOCK_ASSERT(fd, arg) \
@@ -145,7 +145,7 @@ struct filedesc_to_leader {
KASSERT((fd)->fd_locked != 0, ("fdesc locking mistake")); \
else \
KASSERT((fd)->fd_locked == 0, ("fdesc locking mistake")); \
- } while (0);
+ } while (0)
#else
#define FILEDESC_LOCK_ASSERT(fd, arg)
#endif
--- while.diff ends here ---
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-bugs
mailing list