Thu Mar 3 05:52:36 2022 UTC ()
usbnet drivers: Omit needless uno_init locked subroutines.

uno_init is now called with the core lock already held so there is no
need for a separate locked subroutine.


(riastradh)
diff -r1.175 -r1.176 src/sys/dev/usb/if_aue.c
diff -r1.138 -r1.139 src/sys/dev/usb/if_axe.c
diff -r1.80 -r1.81 src/sys/dev/usb/if_axen.c
diff -r1.96 -r1.97 src/sys/dev/usb/if_cue.c
diff -r1.109 -r1.110 src/sys/dev/usb/if_kue.c
diff -r1.12 -r1.13 src/sys/dev/usb/if_mos.c
diff -r1.69 -r1.70 src/sys/dev/usb/if_mue.c
diff -r1.78 -r1.79 src/sys/dev/usb/if_smsc.c
diff -r1.45 -r1.46 src/sys/dev/usb/if_ure.c
diff -r1.84 -r1.85 src/sys/dev/usb/if_url.c

cvs diff -r1.175 -r1.176 src/sys/dev/usb/if_aue.c (expand / switch to context diff)
--- src/sys/dev/usb/if_aue.c 2022/03/03 05:51:17 1.175
+++ src/sys/dev/usb/if_aue.c 2022/03/03 05:52:35 1.176
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_aue.c,v 1.175 2022/03/03 05:51:17 riastradh Exp $	*/
+/*	$NetBSD: if_aue.c,v 1.176 2022/03/03 05:52:35 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1997, 1998, 1999, 2000
@@ -76,7 +76,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_aue.c,v 1.175 2022/03/03 05:51:17 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_aue.c,v 1.176 2022/03/03 05:52:35 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -954,7 +954,7 @@
 }
 
 static int
-aue_init_locked(struct ifnet *ifp)
+aue_uno_init(struct ifnet *ifp)
 {
 	struct usbnet * const	un = ifp->if_softc;
 	struct aue_softc	*sc = usbnet_softc(un);
@@ -996,16 +996,6 @@
 	AUE_SETBIT(sc, AUE_CTL2, AUE_CTL2_EP3_CLR);
 
 	//mii_mediachg(mii);
-
-	return rv;
-}
-
-static int
-aue_uno_init(struct ifnet *ifp)
-{
-	int rv;
-
-	rv = aue_init_locked(ifp);
 
 	return rv;
 }

cvs diff -r1.138 -r1.139 src/sys/dev/usb/if_axe.c (expand / switch to context diff)
--- src/sys/dev/usb/if_axe.c 2022/03/03 05:52:20 1.138
+++ src/sys/dev/usb/if_axe.c 2022/03/03 05:52:35 1.139
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_axe.c,v 1.138 2022/03/03 05:52:20 riastradh Exp $	*/
+/*	$NetBSD: if_axe.c,v 1.139 2022/03/03 05:52:35 riastradh Exp $	*/
 /*	$OpenBSD: if_axe.c,v 1.137 2016/04/13 11:03:37 mpi Exp $ */
 
 /*
@@ -87,7 +87,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_axe.c,v 1.138 2022/03/03 05:52:20 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_axe.c,v 1.139 2022/03/03 05:52:35 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -1210,7 +1210,7 @@
 }
 
 static int
-axe_init_locked(struct ifnet *ifp)
+axe_uno_init(struct ifnet *ifp)
 {
 	AXEHIST_FUNC(); AXEHIST_CALLED();
 	struct usbnet * const un = ifp->if_softc;
@@ -1304,14 +1304,6 @@
 	axe_rcvfilt_locked(un);
 
 	return usbnet_init_rx_tx(un);
-}
-
-static int
-axe_uno_init(struct ifnet *ifp)
-{
-	int ret = axe_init_locked(ifp);
-
-	return ret;
 }
 
 static void

cvs diff -r1.80 -r1.81 src/sys/dev/usb/if_axen.c (expand / switch to context diff)
--- src/sys/dev/usb/if_axen.c 2022/03/03 05:51:44 1.80
+++ src/sys/dev/usb/if_axen.c 2022/03/03 05:52:35 1.81
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_axen.c,v 1.80 2022/03/03 05:51:44 riastradh Exp $	*/
+/*	$NetBSD: if_axen.c,v 1.81 2022/03/03 05:52:35 riastradh Exp $	*/
 /*	$OpenBSD: if_axen.c,v 1.3 2013/10/21 10:10:22 yuo Exp $	*/
 
 /*
@@ -23,7 +23,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_axen.c,v 1.80 2022/03/03 05:51:44 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_axen.c,v 1.81 2022/03/03 05:52:35 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -894,7 +894,7 @@
 }
 
 static int
-axen_init_locked(struct ifnet *ifp)
+axen_uno_init(struct ifnet *ifp)
 {
 	struct usbnet * const un = ifp->if_softc;
 	uint16_t rxmode;
@@ -930,14 +930,6 @@
 	axen_cmd(un, AXEN_CMD_MAC_WRITE2, 2, AXEN_MAC_RXCTL, &wval);
 
 	return usbnet_init_rx_tx(un);
-}
-
-static int
-axen_uno_init(struct ifnet *ifp)
-{
-	int ret = axen_init_locked(ifp);
-
-	return ret;
 }
 
 static void

cvs diff -r1.96 -r1.97 src/sys/dev/usb/if_cue.c (expand / switch to context diff)
--- src/sys/dev/usb/if_cue.c 2022/03/03 05:51:27 1.96
+++ src/sys/dev/usb/if_cue.c 2022/03/03 05:52:35 1.97
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_cue.c,v 1.96 2022/03/03 05:51:27 riastradh Exp $	*/
+/*	$NetBSD: if_cue.c,v 1.97 2022/03/03 05:52:35 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1997, 1998, 1999, 2000
@@ -57,7 +57,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_cue.c,v 1.96 2022/03/03 05:51:27 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_cue.c,v 1.97 2022/03/03 05:52:35 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -613,7 +613,7 @@
 }
 
 static int
-cue_init_locked(struct ifnet *ifp)
+cue_uno_init(struct ifnet *ifp)
 {
 	struct usbnet * const	un = ifp->if_softc;
 	int			i, ctl;
@@ -665,16 +665,6 @@
 	cue_csr_write_1(un, CUE_LEDCTL, CUE_LEDCTL_FOLLOW_LINK);
 
 	return usbnet_init_rx_tx(un);
-}
-
-static int
-cue_uno_init(struct ifnet *ifp)
-{
-	int rv;
-
-	rv = cue_init_locked(ifp);
-
-	return rv;
 }
 
 static void

cvs diff -r1.109 -r1.110 src/sys/dev/usb/if_kue.c (expand / switch to context diff)
--- src/sys/dev/usb/if_kue.c 2022/03/03 05:51:27 1.109
+++ src/sys/dev/usb/if_kue.c 2022/03/03 05:52:35 1.110
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_kue.c,v 1.109 2022/03/03 05:51:27 riastradh Exp $	*/
+/*	$NetBSD: if_kue.c,v 1.110 2022/03/03 05:52:35 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1997, 1998, 1999, 2000
@@ -71,7 +71,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_kue.c,v 1.109 2022/03/03 05:51:27 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_kue.c,v 1.110 2022/03/03 05:52:35 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -591,7 +591,7 @@
 }
 
 static int
-kue_init_locked(struct ifnet *ifp)
+kue_uno_init(struct ifnet *ifp)
 {
 	struct usbnet * const	un = ifp->if_softc;
 	struct kue_softc	*sc = usbnet_softc(un);
@@ -625,16 +625,6 @@
 	kue_setiff_locked(un);
 
 	return usbnet_init_rx_tx(un);
-}
-
-static int
-kue_uno_init(struct ifnet *ifp)
-{
-	int rv;
-
-	rv = kue_init_locked(ifp);
-
-	return rv;
 }
 
 static void

cvs diff -r1.12 -r1.13 src/sys/dev/usb/if_mos.c (expand / switch to context diff)
--- src/sys/dev/usb/if_mos.c 2022/03/03 05:51:27 1.12
+++ src/sys/dev/usb/if_mos.c 2022/03/03 05:52:35 1.13
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_mos.c,v 1.12 2022/03/03 05:51:27 riastradh Exp $	*/
+/*	$NetBSD: if_mos.c,v 1.13 2022/03/03 05:52:35 riastradh Exp $	*/
 /*	$OpenBSD: if_mos.c,v 1.40 2019/07/07 06:40:10 kevlo Exp $	*/
 
 /*
@@ -72,7 +72,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_mos.c,v 1.12 2022/03/03 05:51:27 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_mos.c,v 1.13 2022/03/03 05:52:35 riastradh Exp $");
 
 #include <sys/param.h>
 
@@ -723,7 +723,7 @@
 }
 
 static int
-mos_init_locked(struct ifnet *ifp)
+mos_uno_init(struct ifnet *ifp)
 {
 	struct usbnet * const un = ifp->if_softc;
 	u_int8_t		rxmode;
@@ -757,14 +757,6 @@
 	mos_reg_write_1(un, MOS_CTL, rxmode);
 
 	return usbnet_init_rx_tx(un);
-}
-
-static int
-mos_uno_init(struct ifnet *ifp)
-{
-	int ret = mos_init_locked(ifp);
-
-	return ret;
 }
 
 static void

cvs diff -r1.69 -r1.70 src/sys/dev/usb/if_mue.c (expand / switch to context diff)
--- src/sys/dev/usb/if_mue.c 2022/03/03 05:51:35 1.69
+++ src/sys/dev/usb/if_mue.c 2022/03/03 05:52:35 1.70
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_mue.c,v 1.69 2022/03/03 05:51:35 riastradh Exp $	*/
+/*	$NetBSD: if_mue.c,v 1.70 2022/03/03 05:52:35 riastradh Exp $	*/
 /*	$OpenBSD: if_mue.c,v 1.3 2018/08/04 16:42:46 jsg Exp $	*/
 
 /*
@@ -20,7 +20,7 @@
 /* Driver for Microchip LAN7500/LAN7800 chipsets. */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_mue.c,v 1.69 2022/03/03 05:51:35 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_mue.c,v 1.70 2022/03/03 05:52:35 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -1223,7 +1223,7 @@
 }
 
 static int
-mue_init_locked(struct ifnet *ifp)
+mue_uno_init(struct ifnet *ifp)
 {
 	struct usbnet * const un = ifp->if_softc;
 
@@ -1251,16 +1251,6 @@
 	mue_setmtu_locked(un);
 
 	return usbnet_init_rx_tx(un);
-}
-
-static int
-mue_uno_init(struct ifnet *ifp)
-{
-	int rv;
-
-	rv = mue_init_locked(ifp);
-
-	return rv;
 }
 
 static int

cvs diff -r1.78 -r1.79 src/sys/dev/usb/if_smsc.c (expand / switch to context diff)
--- src/sys/dev/usb/if_smsc.c 2022/03/03 05:51:44 1.78
+++ src/sys/dev/usb/if_smsc.c 2022/03/03 05:52:35 1.79
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_smsc.c,v 1.78 2022/03/03 05:51:44 riastradh Exp $	*/
+/*	$NetBSD: if_smsc.c,v 1.79 2022/03/03 05:52:35 riastradh Exp $	*/
 
 /*	$OpenBSD: if_smsc.c,v 1.4 2012/09/27 12:38:11 jsg Exp $	*/
 /*	$FreeBSD: src/sys/dev/usb/net/if_smsc.c,v 1.1 2012/08/15 04:03:55 gonzo Exp $ */
@@ -61,7 +61,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_smsc.c,v 1.78 2022/03/03 05:51:44 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_smsc.c,v 1.79 2022/03/03 05:52:35 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -174,7 +174,6 @@
 static int	 smsc_setmacaddress(struct usbnet *, const uint8_t *);
 
 static int	 smsc_uno_init(struct ifnet *);
-static int	 smsc_init_locked(struct ifnet *);
 static void	 smsc_uno_stop(struct ifnet *, int);
 
 static void	 smsc_reset(struct smsc_softc *);
@@ -553,14 +552,6 @@
 
 static int
 smsc_uno_init(struct ifnet *ifp)
-{
-	int ret = smsc_init_locked(ifp);
-
-	return ret;
-}
-
-static int
-smsc_init_locked(struct ifnet *ifp)
 {
 	struct usbnet * const un = ifp->if_softc;
 	struct smsc_softc * const sc = usbnet_softc(un);

cvs diff -r1.45 -r1.46 src/sys/dev/usb/if_ure.c (expand / switch to context diff)
--- src/sys/dev/usb/if_ure.c 2022/03/03 05:51:27 1.45
+++ src/sys/dev/usb/if_ure.c 2022/03/03 05:52:35 1.46
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_ure.c,v 1.45 2022/03/03 05:51:27 riastradh Exp $	*/
+/*	$NetBSD: if_ure.c,v 1.46 2022/03/03 05:52:35 riastradh Exp $	*/
 /*	$OpenBSD: if_ure.c,v 1.10 2018/11/02 21:32:30 jcs Exp $	*/
 
 /*-
@@ -30,7 +30,7 @@
 /* RealTek RTL8152/RTL8153 10/100/Gigabit USB Ethernet device */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_ure.c,v 1.45 2022/03/03 05:51:27 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ure.c,v 1.46 2022/03/03 05:52:35 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -408,7 +408,7 @@
 }
 
 static int
-ure_init_locked(struct ifnet *ifp)
+ure_uno_init(struct ifnet *ifp)
 {
 	struct usbnet * const un = ifp->if_softc;
 	uint8_t eaddr[8];
@@ -451,14 +451,6 @@
 	ure_rcvfilt_locked(un);
 
 	return usbnet_init_rx_tx(un);
-}
-
-static int
-ure_uno_init(struct ifnet *ifp)
-{
-	int ret = ure_init_locked(ifp);
-
-	return ret;
 }
 
 static void

cvs diff -r1.84 -r1.85 src/sys/dev/usb/if_url.c (expand / switch to context diff)
--- src/sys/dev/usb/if_url.c 2022/03/03 05:51:44 1.84
+++ src/sys/dev/usb/if_url.c 2022/03/03 05:52:35 1.85
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_url.c,v 1.84 2022/03/03 05:51:44 riastradh Exp $	*/
+/*	$NetBSD: if_url.c,v 1.85 2022/03/03 05:52:35 riastradh Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002
@@ -44,7 +44,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_url.c,v 1.84 2022/03/03 05:51:44 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_url.c,v 1.85 2022/03/03 05:52:35 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -363,7 +363,7 @@
 }
 
 static int
-url_init_locked(struct ifnet *ifp)
+url_uno_init(struct ifnet *ifp)
 {
 	struct usbnet * const un = ifp->if_softc;
 	const u_char *eaddr;
@@ -399,14 +399,6 @@
 	URL_SETBIT(un, URL_CR, URL_CR_TE | URL_CR_RE);
 
 	return usbnet_init_rx_tx(un);
-}
-
-static int
-url_uno_init(struct ifnet *ifp)
-{
-	int ret = url_init_locked(ifp);
-
-	return ret;
 }
 
 static void