Sat Jan 27 00:00:26 2018 UTC ()
remove useless KASSERT.


(christos)
diff -r1.260 -r1.261 src/sys/kern/kern_sysctl.c

cvs diff -r1.260 -r1.261 src/sys/kern/kern_sysctl.c (expand / switch to unified diff)

--- src/sys/kern/kern_sysctl.c 2018/01/26 22:54:33 1.260
+++ src/sys/kern/kern_sysctl.c 2018/01/27 00:00:26 1.261
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: kern_sysctl.c,v 1.260 2018/01/26 22:54:33 pgoyette Exp $ */ 1/* $NetBSD: kern_sysctl.c,v 1.261 2018/01/27 00:00:26 christos Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2003, 2007, 2008 The NetBSD Foundation, Inc. 4 * Copyright (c) 2003, 2007, 2008 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Andrew Brown. 8 * by Andrew Brown.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -58,27 +58,27 @@ @@ -58,27 +58,27 @@
58 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 58 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
59 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 59 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
60 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 60 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
61 * SUCH DAMAGE. 61 * SUCH DAMAGE.
62 * 62 *
63 * @(#)kern_sysctl.c 8.9 (Berkeley) 5/20/95 63 * @(#)kern_sysctl.c 8.9 (Berkeley) 5/20/95
64 */ 64 */
65 65
66/* 66/*
67 * sysctl system call. 67 * sysctl system call.
68 */ 68 */
69 69
70#include <sys/cdefs.h> 70#include <sys/cdefs.h>
71__KERNEL_RCSID(0, "$NetBSD: kern_sysctl.c,v 1.260 2018/01/26 22:54:33 pgoyette Exp $"); 71__KERNEL_RCSID(0, "$NetBSD: kern_sysctl.c,v 1.261 2018/01/27 00:00:26 christos Exp $");
72 72
73#ifdef _KERNEL_OPT 73#ifdef _KERNEL_OPT
74#include "opt_defcorename.h" 74#include "opt_defcorename.h"
75#endif 75#endif
76 76
77#include "ksyms.h" 77#include "ksyms.h"
78 78
79#include <sys/param.h> 79#include <sys/param.h>
80#define __COMPAT_SYSCTL 80#define __COMPAT_SYSCTL
81#include <sys/sysctl.h> 81#include <sys/sysctl.h>
82#include <sys/systm.h> 82#include <sys/systm.h>
83#include <sys/buf.h> 83#include <sys/buf.h>
84#include <sys/ksyms.h> 84#include <sys/ksyms.h>
@@ -2405,28 +2405,26 @@ sysctl_log_print(const struct sysctllog  @@ -2405,28 +2405,26 @@ sysctl_log_print(const struct sysctllog
2405 } 2405 }
2406 } 2406 }
2407 printf(" end\n"); 2407 printf(" end\n");
2408} 2408}
2409 2409
2410int 2410int
2411sysctl_log_add(struct sysctllog **logp, const struct sysctlnode *node) 2411sysctl_log_add(struct sysctllog **logp, const struct sysctlnode *node)
2412{ 2412{
2413 const int size0 = 16; 2413 const int size0 = 16;
2414 int name[CTL_MAXNAME], namelen, i; 2414 int name[CTL_MAXNAME], namelen, i;
2415 const struct sysctlnode *pnode; 2415 const struct sysctlnode *pnode;
2416 struct sysctllog *log; 2416 struct sysctllog *log;
2417 2417
2418 KASSERT(namelen < CTL_MAXNAME); 
2419 
2420 if (node->sysctl_flags & CTLFLAG_PERMANENT) 2418 if (node->sysctl_flags & CTLFLAG_PERMANENT)
2421 return (0); 2419 return (0);
2422 2420
2423 if (logp == NULL) 2421 if (logp == NULL)
2424 return (0); 2422 return (0);
2425 2423
2426 if (*logp == NULL) { 2424 if (*logp == NULL) {
2427 log = malloc(sizeof(struct sysctllog), 2425 log = malloc(sizeof(struct sysctllog),
2428 M_SYSCTLDATA, M_WAITOK|M_CANFAIL); 2426 M_SYSCTLDATA, M_WAITOK|M_CANFAIL);
2429 if (log == NULL) { 2427 if (log == NULL) {
2430 /* XXX print error message? */ 2428 /* XXX print error message? */
2431 return (-1); 2429 return (-1);
2432 } 2430 }