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(9): Omit needless usbnet_core_mutex funct...
details: https://anonhg.NetBSD.org/src/rev/e95e424aa4fc
branches: trunk
changeset: 369407:e95e424aa4fc
user: riastradh <riastradh%NetBSD.org@localhost>
date: Tue Aug 16 00:44:20 2022 +0000
description:
usbnet(9): Omit needless usbnet_core_mutex function.
While here, use inline, not __inline__, since this is not a header
file where inline might be redefined by the user.
diffstat:
sys/dev/usb/usbnet.c | 18 ++++++------------
1 files changed, 6 insertions(+), 12 deletions(-)
diffs (49 lines):
diff -r 2dce4a344113 -r e95e424aa4fc sys/dev/usb/usbnet.c
--- a/sys/dev/usb/usbnet.c Tue Aug 16 00:26:39 2022 +0000
+++ b/sys/dev/usb/usbnet.c Tue Aug 16 00:44:20 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: usbnet.c,v 1.96 2022/08/12 11:25:45 riastradh Exp $ */
+/* $NetBSD: usbnet.c,v 1.97 2022/08/16 00:44:20 riastradh Exp $ */
/*
* Copyright (c) 2019 Matthew R. Green
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: usbnet.c,v 1.96 2022/08/12 11:25:45 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: usbnet.c,v 1.97 2022/08/16 00:44:20 riastradh Exp $");
#include <sys/param.h>
#include <sys/kernel.h>
@@ -102,16 +102,10 @@
static void usbnet_isowned_rx(struct usbnet *);
static void usbnet_isowned_tx(struct usbnet *);
-static kmutex_t *
-usbnet_mutex_core(struct usbnet *un)
-{
- return &un->un_pri->unp_core_lock;
-}
-
-static __inline__ void
+static inline void
usbnet_isowned_core(struct usbnet *un)
{
- KASSERT(mutex_owned(usbnet_mutex_core(un)));
+ KASSERT(mutex_owned(&un->un_pri->unp_core_lock));
}
static int usbnet_modcmd(modcmd_t, void *);
@@ -1431,9 +1425,9 @@
usbnet_ec(un)->ec_mii = mii;
ifmedia_init_with_lock(&mii->mii_media, 0,
- usbnet_media_upd, ether_mediastatus, usbnet_mutex_core(un));
+ usbnet_media_upd, ether_mediastatus, &unp->unp_core_lock);
mii_attach(un->un_dev, mii, unm->un_mii_capmask, unm->un_mii_phyloc,
- unm->un_mii_offset, unm->un_mii_flags);
+ unm->un_mii_offset, unm->un_mii_flags);
if (LIST_FIRST(&mii->mii_phys) == NULL) {
ifmedia_add(&mii->mii_media, IFM_ETHER | IFM_NONE, 0, NULL);
Home |
Main Index |
Thread Index |
Old Index