Module Name:    src
Committed By:   riastradh
Date:           Thu Mar  3 05:52:36 UTC 2022

Modified Files:
        src/sys/dev/usb: if_aue.c if_axe.c if_axen.c if_cue.c if_kue.c if_mos.c
            if_mue.c if_smsc.c if_ure.c if_url.c

Log Message:
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.


To generate a diff of this commit:
cvs rdiff -u -r1.175 -r1.176 src/sys/dev/usb/if_aue.c
cvs rdiff -u -r1.138 -r1.139 src/sys/dev/usb/if_axe.c
cvs rdiff -u -r1.80 -r1.81 src/sys/dev/usb/if_axen.c
cvs rdiff -u -r1.96 -r1.97 src/sys/dev/usb/if_cue.c
cvs rdiff -u -r1.109 -r1.110 src/sys/dev/usb/if_kue.c
cvs rdiff -u -r1.12 -r1.13 src/sys/dev/usb/if_mos.c
cvs rdiff -u -r1.69 -r1.70 src/sys/dev/usb/if_mue.c
cvs rdiff -u -r1.78 -r1.79 src/sys/dev/usb/if_smsc.c
cvs rdiff -u -r1.45 -r1.46 src/sys/dev/usb/if_ure.c
cvs rdiff -u -r1.84 -r1.85 src/sys/dev/usb/if_url.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/usb/if_aue.c
diff -u src/sys/dev/usb/if_aue.c:1.175 src/sys/dev/usb/if_aue.c:1.176
--- src/sys/dev/usb/if_aue.c:1.175	Thu Mar  3 05:51:17 2022
+++ src/sys/dev/usb/if_aue.c	Thu Mar  3 05:52:35 2022
@@ -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 @@ aue_uno_tx_prepare(struct usbnet *un, st
 }
 
 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);
@@ -1000,16 +1000,6 @@ aue_init_locked(struct ifnet *ifp)
 	return rv;
 }
 
-static int
-aue_uno_init(struct ifnet *ifp)
-{
-	int rv;
-
-	rv = aue_init_locked(ifp);
-
-	return rv;
-}
-
 static void
 aue_uno_mcast(struct ifnet *ifp)
 {

Index: src/sys/dev/usb/if_axe.c
diff -u src/sys/dev/usb/if_axe.c:1.138 src/sys/dev/usb/if_axe.c:1.139
--- src/sys/dev/usb/if_axe.c:1.138	Thu Mar  3 05:52:20 2022
+++ src/sys/dev/usb/if_axe.c	Thu Mar  3 05:52:35 2022
@@ -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 @@ axe_csum_cfg(struct axe_softc *sc)
 }
 
 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;
@@ -1306,14 +1306,6 @@ axe_init_locked(struct ifnet *ifp)
 	return usbnet_init_rx_tx(un);
 }
 
-static int
-axe_uno_init(struct ifnet *ifp)
-{
-	int ret = axe_init_locked(ifp);
-
-	return ret;
-}
-
 static void
 axe_uno_mcast(struct ifnet *ifp)
 {

Index: src/sys/dev/usb/if_axen.c
diff -u src/sys/dev/usb/if_axen.c:1.80 src/sys/dev/usb/if_axen.c:1.81
--- src/sys/dev/usb/if_axen.c:1.80	Thu Mar  3 05:51:44 2022
+++ src/sys/dev/usb/if_axen.c	Thu Mar  3 05:52:35 2022
@@ -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 @@ axen_uno_tx_prepare(struct usbnet *un, s
 }
 
 static int
-axen_init_locked(struct ifnet *ifp)
+axen_uno_init(struct ifnet *ifp)
 {
 	struct usbnet * const un = ifp->if_softc;
 	uint16_t rxmode;
@@ -932,14 +932,6 @@ axen_init_locked(struct ifnet *ifp)
 	return usbnet_init_rx_tx(un);
 }
 
-static int
-axen_uno_init(struct ifnet *ifp)
-{
-	int ret = axen_init_locked(ifp);
-
-	return ret;
-}
-
 static void
 axen_uno_stop(struct ifnet *ifp, int disable)
 {

Index: src/sys/dev/usb/if_cue.c
diff -u src/sys/dev/usb/if_cue.c:1.96 src/sys/dev/usb/if_cue.c:1.97
--- src/sys/dev/usb/if_cue.c:1.96	Thu Mar  3 05:51:27 2022
+++ src/sys/dev/usb/if_cue.c	Thu Mar  3 05:52:35 2022
@@ -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 @@ cue_uno_tx_prepare(struct usbnet *un, st
 }
 
 static int
-cue_init_locked(struct ifnet *ifp)
+cue_uno_init(struct ifnet *ifp)
 {
 	struct usbnet * const	un = ifp->if_softc;
 	int			i, ctl;
@@ -667,16 +667,6 @@ cue_init_locked(struct ifnet *ifp)
 	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
 cue_uno_mcast(struct ifnet *ifp)
 {

Index: src/sys/dev/usb/if_kue.c
diff -u src/sys/dev/usb/if_kue.c:1.109 src/sys/dev/usb/if_kue.c:1.110
--- src/sys/dev/usb/if_kue.c:1.109	Thu Mar  3 05:51:27 2022
+++ src/sys/dev/usb/if_kue.c	Thu Mar  3 05:52:35 2022
@@ -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 @@ kue_uno_tx_prepare(struct usbnet *un, st
 }
 
 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);
@@ -627,16 +627,6 @@ kue_init_locked(struct ifnet *ifp)
 	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
 kue_uno_mcast(struct ifnet *ifp)
 {

Index: src/sys/dev/usb/if_mos.c
diff -u src/sys/dev/usb/if_mos.c:1.12 src/sys/dev/usb/if_mos.c:1.13
--- src/sys/dev/usb/if_mos.c:1.12	Thu Mar  3 05:51:27 2022
+++ src/sys/dev/usb/if_mos.c	Thu Mar  3 05:52:35 2022
@@ -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 @@ mos_uno_tx_prepare(struct usbnet *un, st
 }
 
 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;
@@ -759,14 +759,6 @@ mos_init_locked(struct ifnet *ifp)
 	return usbnet_init_rx_tx(un);
 }
 
-static int
-mos_uno_init(struct ifnet *ifp)
-{
-	int ret = mos_init_locked(ifp);
-
-	return ret;
-}
-
 static void
 mos_uno_mcast(struct ifnet *ifp)
 {

Index: src/sys/dev/usb/if_mue.c
diff -u src/sys/dev/usb/if_mue.c:1.69 src/sys/dev/usb/if_mue.c:1.70
--- src/sys/dev/usb/if_mue.c:1.69	Thu Mar  3 05:51:35 2022
+++ src/sys/dev/usb/if_mue.c	Thu Mar  3 05:52:35 2022
@@ -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 @@ mue_uno_rx_loop(struct usbnet *un, struc
 }
 
 static int
-mue_init_locked(struct ifnet *ifp)
+mue_uno_init(struct ifnet *ifp)
 {
 	struct usbnet * const un = ifp->if_softc;
 
@@ -1254,16 +1254,6 @@ mue_init_locked(struct ifnet *ifp)
 }
 
 static int
-mue_uno_init(struct ifnet *ifp)
-{
-	int rv;
-
-	rv = mue_init_locked(ifp);
-
-	return rv;
-}
-
-static int
 mue_uno_ioctl(struct ifnet *ifp, u_long cmd, void *data)
 {
 	struct usbnet * const un = ifp->if_softc;

Index: src/sys/dev/usb/if_smsc.c
diff -u src/sys/dev/usb/if_smsc.c:1.78 src/sys/dev/usb/if_smsc.c:1.79
--- src/sys/dev/usb/if_smsc.c:1.78	Thu Mar  3 05:51:44 2022
+++ src/sys/dev/usb/if_smsc.c	Thu Mar  3 05:52:35 2022
@@ -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_chip_init(struct usbnet
 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 *);
@@ -554,14 +553,6 @@ smsc_reset(struct smsc_softc *sc)
 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);
 

Index: src/sys/dev/usb/if_ure.c
diff -u src/sys/dev/usb/if_ure.c:1.45 src/sys/dev/usb/if_ure.c:1.46
--- src/sys/dev/usb/if_ure.c:1.45	Thu Mar  3 05:51:27 2022
+++ src/sys/dev/usb/if_ure.c	Thu Mar  3 05:52:35 2022
@@ -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 @@ ure_reset(struct usbnet *un)
 }
 
 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];
@@ -453,14 +453,6 @@ ure_init_locked(struct ifnet *ifp)
 	return usbnet_init_rx_tx(un);
 }
 
-static int
-ure_uno_init(struct ifnet *ifp)
-{
-	int ret = ure_init_locked(ifp);
-
-	return ret;
-}
-
 static void
 ure_uno_stop(struct ifnet *ifp, int disable __unused)
 {

Index: src/sys/dev/usb/if_url.c
diff -u src/sys/dev/usb/if_url.c:1.84 src/sys/dev/usb/if_url.c:1.85
--- src/sys/dev/usb/if_url.c:1.84	Thu Mar  3 05:51:44 2022
+++ src/sys/dev/usb/if_url.c	Thu Mar  3 05:52:35 2022
@@ -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 @@ url_csr_write_4(struct usbnet *un, int r
 }
 
 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;
@@ -401,14 +401,6 @@ url_init_locked(struct ifnet *ifp)
 	return usbnet_init_rx_tx(un);
 }
 
-static int
-url_uno_init(struct ifnet *ifp)
-{
-	int ret = url_init_locked(ifp);
-
-	return ret;
-}
-
 static void
 url_reset(struct usbnet *un)
 {

Reply via email to