From antoine@madhouse.dreadbsd.org  Thu Jul  7 10:17:31 2005
Return-Path: <antoine@madhouse.dreadbsd.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 522C016A41F
	for <FreeBSD-gnats-submit@freebsd.org>; Thu,  7 Jul 2005 10:17:31 +0000 (GMT)
	(envelope-from antoine@madhouse.dreadbsd.org)
Received: from barton.dreadbsd.org (madhouse.dreadbsd.org [82.67.196.50])
	by mx1.FreeBSD.org (Postfix) with ESMTP id C94D243D48
	for <FreeBSD-gnats-submit@freebsd.org>; Thu,  7 Jul 2005 10:17:30 +0000 (GMT)
	(envelope-from antoine@madhouse.dreadbsd.org)
Received: from barton.dreadbsd.org (localhost [127.0.0.1])
	by barton.dreadbsd.org (8.13.4/8.13.4) with ESMTP id j67AHTMD076608
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 7 Jul 2005 12:17:29 +0200 (CEST)
	(envelope-from antoine@madhouse.dreadbsd.org)
Received: (from antoine@localhost)
	by barton.dreadbsd.org (8.13.4/8.13.1/Submit) id j67AHSxP076607;
	Thu, 7 Jul 2005 12:17:28 +0200 (CEST)
	(envelope-from antoine)
Message-Id: <200507071017.j67AHSxP076607@barton.dreadbsd.org>
Date: Thu, 7 Jul 2005 12:17:28 +0200 (CEST)
From: Antoine Brodin <antoine.brodin@laposte.net>
Reply-To: Antoine Brodin <antoine.brodin@laposte.net>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [patch] remove a few bogous semicolons
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         83088
>Category:       kern
>Synopsis:       [patch] remove a few bogous semicolons
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    andre
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jul 07 10:20:14 GMT 2005
>Closed-Date:    Wed Sep 14 14:59:31 GMT 2005
>Last-Modified:  Wed Sep 14 14:59:31 GMT 2005
>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@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:
Responsible-Changed-From-To: freebsd-bugs->andre 
Responsible-Changed-By: andre 
Responsible-Changed-When: Tue Aug 30 13:58:31 GMT 2005 
Responsible-Changed-Why:  
Look into this. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=83088 
State-Changed-From-To: open->patched 
State-Changed-By: andre 
State-Changed-When: Wed Sep 14 14:57:42 GMT 2005 
State-Changed-Why:  
Patch committed to -current. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=83088 
State-Changed-From-To: patched->closed 
State-Changed-By: andre 
State-Changed-When: Wed Sep 14 14:58:34 GMT 2005 
State-Changed-Why:  
Only cosmetic changes.  No MFC to RELENG_6 or RELENG_5 planned. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=83088 
>Unformatted:
