Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci Reduces useless "vmxnet3_read_cmd(sc, VMXNET3_CM...



details:   https://anonhg.NetBSD.org/src/rev/189e13c683d7
branches:  trunk
changeset: 1015125:189e13c683d7
user:      ryo <ryo%NetBSD.org@localhost>
date:      Thu Oct 15 04:37:48 2020 +0000

description:
Reduces useless "vmxnet3_read_cmd(sc, VMXNET3_CMD_GET_LINK)" calls

diffstat:

 sys/dev/pci/if_vmx.c |  15 +++++++--------
 1 files changed, 7 insertions(+), 8 deletions(-)

diffs (36 lines):

diff -r bee86141b2c2 -r 189e13c683d7 sys/dev/pci/if_vmx.c
--- a/sys/dev/pci/if_vmx.c      Thu Oct 15 04:33:24 2020 +0000
+++ b/sys/dev/pci/if_vmx.c      Thu Oct 15 04:37:48 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_vmx.c,v 1.3 2020/10/15 04:33:24 ryo Exp $   */
+/*     $NetBSD: if_vmx.c,v 1.4 2020/10/15 04:37:48 ryo Exp $   */
 /*     $OpenBSD: if_vmx.c,v 1.16 2014/01/22 06:04:17 brad Exp $        */
 
 /*
@@ -19,7 +19,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_vmx.c,v 1.3 2020/10/15 04:33:24 ryo Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_vmx.c,v 1.4 2020/10/15 04:37:48 ryo Exp $");
 
 #include <sys/param.h>
 #include <sys/cpu.h>
@@ -3486,12 +3486,11 @@
 vmxnet3_if_link_status(struct vmxnet3_softc *sc)
 {
        struct ifnet *ifp = &sc->vmx_ethercom.ec_if;
-       u_int x, link;
-
-       vmxnet3_cmd_link_status(ifp);
-
-       x = vmxnet3_read_cmd(sc, VMXNET3_CMD_GET_LINK);
-       if (x & 1) {
+       u_int link;
+       bool up;
+
+       up = vmxnet3_cmd_link_status(ifp);
+       if (up) {
                sc->vmx_link_active = 1;
                link = LINK_STATE_UP;
        } else {



Home | Main Index | Thread Index | Old Index