Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/usb usbnet: Omit needless unp == NULL test in usbnet...



details:   https://anonhg.NetBSD.org/src/rev/25c3e834d6ca
branches:  trunk
changeset: 362492:25c3e834d6ca
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Thu Mar 03 05:47:58 2022 +0000

description:
usbnet: Omit needless unp == NULL test in usbnet_tick_task.

The task is never scheduled until after un->un_pri is initialized,
and un->un_pri isn't nulled until after the callout and task are
quiescent.

diffstat:

 sys/dev/usb/usbnet.c |  7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

diffs (28 lines):

diff -r d5ae0795a30f -r 25c3e834d6ca sys/dev/usb/usbnet.c
--- a/sys/dev/usb/usbnet.c      Thu Mar 03 05:47:50 2022 +0000
+++ b/sys/dev/usb/usbnet.c      Thu Mar 03 05:47:58 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: usbnet.c,v 1.53 2022/03/03 05:47:50 riastradh Exp $    */
+/*     $NetBSD: usbnet.c,v 1.54 2022/03/03 05:47:58 riastradh Exp $    */
 
 /*
  * Copyright (c) 2019 Matthew R. Green
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: usbnet.c,v 1.53 2022/03/03 05:47:50 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: usbnet.c,v 1.54 2022/03/03 05:47:58 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/kernel.h>
@@ -1227,9 +1227,6 @@
        struct usbnet * const un = arg;
        struct usbnet_private * const unp = un->un_pri;
 
-       if (unp == NULL)
-               return;
-
        USBNETHIST_CALLARGSN(8, "%jd: enter", unp->unp_number, 0, 0, 0);
 
        mutex_enter(&unp->unp_core_lock);



Home | Main Index | Thread Index | Old Index