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
This commit is contained in:
Brooks Davis 2019-01-22 17:39:26 +00:00
parent 5f81babdee
commit bc6f170e30

View File

@ -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, struct thread *td)
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, struct thread *td)
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, struct thread *td)
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;