Source-Changes-HG archive

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

[src/trunk]: src/sys/net/lagg lagg(4): use KASSERT



details:   https://anonhg.NetBSD.org/src/rev/2d1219f6f3c7
branches:  trunk
changeset: 364599:2d1219f6f3c7
user:      yamaguchi <yamaguchi%NetBSD.org@localhost>
date:      Thu Mar 31 02:07:26 2022 +0000

description:
lagg(4): use KASSERT

diffstat:

 sys/net/lagg/if_laggproto.c |  12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diffs (40 lines):

diff -r 9a9a60e3d027 -r 2d1219f6f3c7 sys/net/lagg/if_laggproto.c
--- a/sys/net/lagg/if_laggproto.c       Thu Mar 31 02:04:50 2022 +0000
+++ b/sys/net/lagg/if_laggproto.c       Thu Mar 31 02:07:26 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_laggproto.c,v 1.2 2021/05/24 13:43:21 thorpej Exp $ */
+/*     $NetBSD: if_laggproto.c,v 1.3 2022/03/31 02:07:26 yamaguchi Exp $       */
 
 /*-
  * SPDX-License-Identifier: BSD-2-Clause-NetBSD
@@ -29,7 +29,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_laggproto.c,v 1.2 2021/05/24 13:43:21 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_laggproto.c,v 1.3 2022/03/31 02:07:26 yamaguchi Exp $");
 
 #include <sys/param.h>
 #include <sys/types.h>
@@ -324,8 +324,8 @@
        lagg_proto_remove_port(psc, pport);
 
        if (pport->lpp_active) {
-               if (psc->psc_nactports > 0)
-                       psc->psc_nactports--;
+               KASSERT(psc->psc_nactports > 0);
+               psc->psc_nactports--;
 
                if (psc->psc_nactports == 0) {
                        ifp = &psc->psc_softc->sc_if;
@@ -355,8 +355,8 @@
                if (psc->psc_nactports == 1)
                        if_link_state_change(ifp, LINK_STATE_UP);
        } else {
-               if (psc->psc_nactports > 0)
-                       psc->psc_nactports--;
+               KASSERT(psc->psc_nactports > 0);
+               psc->psc_nactports--;
 
                if (psc->psc_nactports == 0)
                        if_link_state_change(ifp, LINK_STATE_DOWN);



Home | Main Index | Thread Index | Old Index