From: kn Date: Fri, 21 Apr 2023 00:41:13 +0000 (+0000) Subject: Drop error variable and return directly; OK mvs tb X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=a9069a72af639d219901cb56ce4d1c0d7452cc98;p=openbsd Drop error variable and return directly; OK mvs tb --- diff --git a/sys/netinet/in.c b/sys/netinet/in.c index 1cbfbef2976..0d36710a5a3 100644 --- a/sys/netinet/in.c +++ b/sys/netinet/in.c @@ -1,4 +1,4 @@ -/* $OpenBSD: in.c,v 1.182 2023/04/19 20:03:51 kn Exp $ */ +/* $OpenBSD: in.c,v 1.183 2023/04/21 00:41:13 kn Exp $ */ /* $NetBSD: in.c,v 1.26 1996/02/13 23:41:39 christos Exp $ */ /* @@ -200,7 +200,6 @@ int in_control(struct socket *so, u_long cmd, caddr_t data, struct ifnet *ifp) { int privileged; - int error; privileged = 0; if ((so->so_state & SS_PRIV) != 0) @@ -210,15 +209,11 @@ in_control(struct socket *so, u_long cmd, caddr_t data, struct ifnet *ifp) #ifdef MROUTING case SIOCGETVIFCNT: case SIOCGETSGCNT: - error = mrt_ioctl(so, cmd, data); - break; + return mrt_ioctl(so, cmd, data); #endif /* MROUTING */ default: - error = in_ioctl(cmd, data, ifp, privileged); - break; + return in_ioctl(cmd, data, ifp, privileged); } - - return error; } int diff --git a/sys/netinet6/in6.c b/sys/netinet6/in6.c index ea328b1b782..3651a5f23f6 100644 --- a/sys/netinet6/in6.c +++ b/sys/netinet6/in6.c @@ -1,4 +1,4 @@ -/* $OpenBSD: in6.c,v 1.260 2023/04/19 20:03:52 kn Exp $ */ +/* $OpenBSD: in6.c,v 1.261 2023/04/21 00:41:13 kn Exp $ */ /* $KAME: in6.c,v 1.372 2004/06/14 08:14:21 itojun Exp $ */ /* @@ -197,7 +197,6 @@ int in6_control(struct socket *so, u_long cmd, caddr_t data, struct ifnet *ifp) { int privileged; - int error; privileged = 0; if ((so->so_state & SS_PRIV) != 0) @@ -207,15 +206,11 @@ in6_control(struct socket *so, u_long cmd, caddr_t data, struct ifnet *ifp) #ifdef MROUTING case SIOCGETSGCNT_IN6: case SIOCGETMIFCNT_IN6: - error = mrt6_ioctl(so, cmd, data); - break; + return mrt6_ioctl(so, cmd, data); #endif /* MROUTING */ default: - error = in6_ioctl(cmd, data, ifp, privileged); - break; + return in6_ioctl(cmd, data, ifp, privileged); } - - return error; } int