svn commit: r343305 - head/sys/net

Brooks Davis brooks at FreeBSD.org
Tue Jan 22 17:39:27 UTC 2019


Author: brooks
Date: Tue Jan 22 17:39:26 2019
New Revision: 343305
URL: https://svnweb.freebsd.org/changeset/base/343305

Log:
  Rework CASE_IOC_IFGROUPREQ() to require a case before the macro.
  
  This is more compatible with formatting tools and looks more normal.
  
  Reported by:	jhb (on a different review)
  Sponsored by:	DARPA, AFRL
  Differential Revision:	https://reviews.freebsd.org/D18442

Modified:
  head/sys/net/if.c

Modified: head/sys/net/if.c
==============================================================================
--- head/sys/net/if.c	Tue Jan 22 17:34:53 2019	(r343304)
+++ head/sys/net/if.c	Tue Jan 22 17:39:26 2019	(r343305)
@@ -168,14 +168,14 @@ struct ifmediareq32 {
 #define	SIOCGIFXMEDIA32	_IOC_NEWTYPE(SIOCGIFXMEDIA, struct ifmediareq32)
 
 #define	_CASE_IOC_IFGROUPREQ_32(cmd)				\
-    case _IOC_NEWTYPE((cmd), struct ifgroupreq32):
+    _IOC_NEWTYPE((cmd), struct ifgroupreq32): case
 #else /* !COMPAT_FREEBSD32 */
 #define _CASE_IOC_IFGROUPREQ_32(cmd)
 #endif /* !COMPAT_FREEBSD32 */
 
 #define CASE_IOC_IFGROUPREQ(cmd)	\
     _CASE_IOC_IFGROUPREQ_32(cmd)	\
-    case (cmd)
+    (cmd)
 
 union ifreq_union {
 	struct ifreq	ifr;
@@ -2894,7 +2894,7 @@ ifhwioctl(u_long cmd, struct ifnet *ifp, caddr_t data,
 		error = if_gethwaddr(ifp, ifr);
 		break;
 
-	CASE_IOC_IFGROUPREQ(SIOCAIFGROUP):
+	case CASE_IOC_IFGROUPREQ(SIOCAIFGROUP):
 		error = priv_check(td, PRIV_NET_ADDIFGROUP);
 		if (error)
 			return (error);
@@ -2903,12 +2903,12 @@ ifhwioctl(u_long cmd, struct ifnet *ifp, caddr_t data,
 			return (error);
 		break;
 
-	CASE_IOC_IFGROUPREQ(SIOCGIFGROUP):
+	case CASE_IOC_IFGROUPREQ(SIOCGIFGROUP):
 		if ((error = if_getgroup((struct ifgroupreq *)data, ifp)))
 			return (error);
 		break;
 
-	CASE_IOC_IFGROUPREQ(SIOCDIFGROUP):
+	case CASE_IOC_IFGROUPREQ(SIOCDIFGROUP):
 		error = priv_check(td, PRIV_NET_DELIFGROUP);
 		if (error)
 			return (error);
@@ -3063,7 +3063,7 @@ ifioctl(struct socket *so, u_long cmd, caddr_t data, s
 		error = if_clone_list((struct if_clonereq *)data);
 		goto out_noref;
 
-	CASE_IOC_IFGROUPREQ(SIOCGIFGMEMB):
+	case CASE_IOC_IFGROUPREQ(SIOCGIFGMEMB):
 		error = if_getgroupmembers((struct ifgroupreq *)data);
 		goto out_noref;
 


More information about the svn-src-head mailing list