summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Bluhm <bluhm@cvs.openbsd.org>2022-03-10 21:00:52 +0000
committerAlexander Bluhm <bluhm@cvs.openbsd.org>2022-03-10 21:00:52 +0000
commit046e268658bbeb18565b979530b792a358497b19 (patch)
treedb629e4a627196c0d055099c77eb7fc12ac496e0
parentd41ee5fdb472cbc115846ce051d70f1d49937f0a (diff)
KASSERT should not contain memory barriers as they change behavior.
Read the integer values without atomic operations. OK kettenis@
-rw-r--r--sys/dev/pci/if_iwm.c6
-rw-r--r--sys/dev/pci/if_iwx.c6
2 files changed, 6 insertions, 6 deletions
diff --git a/sys/dev/pci/if_iwm.c b/sys/dev/pci/if_iwm.c
index f813c071381..eece4e0d25a 100644
--- a/sys/dev/pci/if_iwm.c
+++ b/sys/dev/pci/if_iwm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_iwm.c,v 1.392 2022/03/10 15:21:08 bluhm Exp $ */
+/* $OpenBSD: if_iwm.c,v 1.393 2022/03/10 21:00:51 bluhm Exp $ */
/*
* Copyright (c) 2014, 2016 genua gmbh <info@genua.de>
@@ -9975,7 +9975,7 @@ iwm_init(struct ifnet *ifp)
generation = ++sc->sc_generation;
- KASSERT(atomic_load_int(&sc->task_refs.r_refs) == 0);
+ KASSERT(sc->task_refs.r_refs == 0);
refcnt_init(&sc->task_refs);
err = iwm_preinit(sc);
@@ -10116,7 +10116,7 @@ iwm_stop(struct ifnet *ifp)
iwm_del_task(sc, systq, &sc->mac_ctxt_task);
iwm_del_task(sc, systq, &sc->phy_ctxt_task);
iwm_del_task(sc, systq, &sc->bgscan_done_task);
- KASSERT(atomic_load_int(&sc->task_refs.r_refs) >= 1);
+ KASSERT(sc->task_refs.r_refs >= 1);
refcnt_finalize(&sc->task_refs, "iwmstop");
iwm_stop_device(sc);
diff --git a/sys/dev/pci/if_iwx.c b/sys/dev/pci/if_iwx.c
index 9ea26c4f3cb..e2006405f59 100644
--- a/sys/dev/pci/if_iwx.c
+++ b/sys/dev/pci/if_iwx.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_iwx.c,v 1.135 2022/03/10 15:21:08 bluhm Exp $ */
+/* $OpenBSD: if_iwx.c,v 1.136 2022/03/10 21:00:51 bluhm Exp $ */
/*
* Copyright (c) 2014, 2016 genua gmbh <info@genua.de>
@@ -8017,7 +8017,7 @@ iwx_init(struct ifnet *ifp)
if (sc->sc_nvm.sku_cap_11n_enable)
iwx_setup_ht_rates(sc);
- KASSERT(atomic_load_int(&sc->task_refs.r_refs) == 0);
+ KASSERT(sc->task_refs.r_refs == 0);
refcnt_init(&sc->task_refs);
ifq_clr_oactive(&ifp->if_snd);
ifp->if_flags |= IFF_RUNNING;
@@ -8139,7 +8139,7 @@ iwx_stop(struct ifnet *ifp)
iwx_del_task(sc, systq, &sc->mac_ctxt_task);
iwx_del_task(sc, systq, &sc->phy_ctxt_task);
iwx_del_task(sc, systq, &sc->bgscan_done_task);
- KASSERT(atomic_load_int(&sc->task_refs.r_refs) >= 1);
+ KASSERT(sc->task_refs.r_refs >= 1);
refcnt_finalize(&sc->task_refs, "iwxstop");
iwx_stop_device(sc);