Source-Changes-HG archive

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

[src/trunk]: src/sys/net Use macro(ETHER_LOCK() and ETHER_UNLOCK()). No funct...



details:   https://anonhg.NetBSD.org/src/rev/c52e53b3ba89
branches:  trunk
changeset: 357099:c52e53b3ba89
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Thu Oct 26 09:41:15 2017 +0000

description:
Use macro(ETHER_LOCK() and ETHER_UNLOCK()). No functional change.

diffstat:

 sys/net/if_ethersubr.c |  24 ++++++++++++------------
 1 files changed, 12 insertions(+), 12 deletions(-)

diffs (101 lines):

diff -r ec78af66cf34 -r c52e53b3ba89 sys/net/if_ethersubr.c
--- a/sys/net/if_ethersubr.c    Thu Oct 26 07:29:52 2017 +0000
+++ b/sys/net/if_ethersubr.c    Thu Oct 26 09:41:15 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_ethersubr.c,v 1.244 2017/09/26 07:42:06 knakahara Exp $     */
+/*     $NetBSD: if_ethersubr.c,v 1.245 2017/10/26 09:41:15 msaitoh Exp $       */
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -61,7 +61,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_ethersubr.c,v 1.244 2017/09/26 07:42:06 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ethersubr.c,v 1.245 2017/10/26 09:41:15 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -1010,13 +1010,13 @@
                vlan_ifdetach(ifp);
 #endif
 
-       mutex_enter(ec->ec_lock);
+       ETHER_LOCK(ec);
        while ((enm = LIST_FIRST(&ec->ec_multiaddrs)) != NULL) {
                LIST_REMOVE(enm, enm_list);
                kmem_intr_free(enm, sizeof(*enm));
                ec->ec_multicnt--;
        }
-       mutex_exit(ec->ec_lock);
+       ETHER_UNLOCK(ec);
 
        mutex_destroy(ec->ec_lock);
 
@@ -1236,7 +1236,7 @@
        if (enm == NULL)
                return ENOBUFS;
 
-       mutex_enter(ec->ec_lock);
+       ETHER_LOCK(ec);
        error = ether_multiaddr(sa, addrlo, addrhi);
        if (error != 0)
                goto out;
@@ -1275,7 +1275,7 @@
        error = ENETRESET;
        enm = NULL;
 out:
-       mutex_exit(ec->ec_lock);
+       ETHER_UNLOCK(ec);
        if (enm != NULL)
                kmem_intr_free(enm, sizeof(*enm));
        return error;
@@ -1292,7 +1292,7 @@
        u_char addrhi[ETHER_ADDR_LEN];
        int error;
 
-       mutex_enter(ec->ec_lock);
+       ETHER_LOCK(ec);
        error = ether_multiaddr(sa, addrlo, addrhi);
        if (error != 0)
                goto error;
@@ -1317,7 +1317,7 @@
         */
        LIST_REMOVE(enm, enm_list);
        ec->ec_multicnt--;
-       mutex_exit(ec->ec_lock);
+       ETHER_UNLOCK(ec);
 
        kmem_intr_free(enm, sizeof(*enm));
        /*
@@ -1326,7 +1326,7 @@
         */
        return ENETRESET;
 error:
-       mutex_exit(ec->ec_lock);
+       ETHER_UNLOCK(ec);
        return error;
 }
 
@@ -1561,10 +1561,10 @@
        multicnt = ec->ec_multicnt;
        addrs = kmem_alloc(sizeof(*addrs) * multicnt, KM_SLEEP);
 
-       mutex_enter(ec->ec_lock);
+       ETHER_LOCK(ec);
        if (multicnt < ec->ec_multicnt) {
                /* The number of multicast addresses have increased */
-               mutex_exit(ec->ec_lock);
+               ETHER_UNLOCK(ec);
                kmem_free(addrs, sizeof(*addrs) * multicnt);
                goto retry;
        }
@@ -1577,7 +1577,7 @@
                memcpy(addr->enm_addrhi, enm->enm_addrhi, ETHER_ADDR_LEN);
                i++;
        }
-       mutex_exit(ec->ec_lock);
+       ETHER_UNLOCK(ec);
 
        error = 0;
        written = 0;



Home | Main Index | Thread Index | Old Index