Source-Changes-HG archive

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

[src/trunk]: src/sys/netipsec Simplify; we can assume the arguments are alway...



details:   https://anonhg.NetBSD.org/src/rev/308a47e40879
branches:  trunk
changeset: 824164:308a47e40879
user:      ozaki-r <ozaki-r%NetBSD.org@localhost>
date:      Fri May 26 08:00:15 2017 +0000

description:
Simplify; we can assume the arguments are always non-NULL

diffstat:

 sys/netipsec/key.c |  13 +++++--------
 1 files changed, 5 insertions(+), 8 deletions(-)

diffs (34 lines):

diff -r 8673ed90d694 -r 308a47e40879 sys/netipsec/key.c
--- a/sys/netipsec/key.c        Fri May 26 07:42:15 2017 +0000
+++ b/sys/netipsec/key.c        Fri May 26 08:00:15 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: key.c,v 1.141 2017/05/25 03:36:36 ozaki-r Exp $        */
+/*     $NetBSD: key.c,v 1.142 2017/05/26 08:00:15 ozaki-r Exp $        */
 /*     $FreeBSD: src/sys/netipsec/key.c,v 1.3.2.3 2004/02/14 22:23:23 bms Exp $        */
 /*     $KAME: key.c,v 1.191 2001/06/27 10:46:49 sakane Exp $   */
 
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: key.c,v 1.141 2017/05/25 03:36:36 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: key.c,v 1.142 2017/05/26 08:00:15 ozaki-r Exp $");
 
 /*
  * This code is referd to RFC 2367
@@ -4268,12 +4268,9 @@
        const struct secpolicyindex *spidx0,
        const struct secpolicyindex *spidx1)
 {
-       /* sanity */
-       if (spidx0 == NULL && spidx1 == NULL)
-               return 1;
-
-       if (spidx0 == NULL || spidx1 == NULL)
-               return 0;
+
+       KASSERT(spidx0 != NULL);
+       KASSERT(spidx1 != NULL);
 
        if (spidx0->src.sa.sa_family != spidx1->src.sa.sa_family ||
            spidx0->dst.sa.sa_family != spidx1->dst.sa.sa_family ||



Home | Main Index | Thread Index | Old Index