summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorchs <chs@NetBSD.org>2017-06-02 00:32:12 +0000
committerchs <chs@NetBSD.org>2017-06-02 00:32:12 +0000
commitcfcda5a749370cd60b8dfe5a38b8a7c091df6dd1 (patch)
tree03d0db4c01e6eae5c101cae2fcf6e844b37c0566 /sys
parent8702feb1b06d45c385142a9f230518327b3529e2 (diff)
localcount_init() can't fail because percpu_alloc() can't fail.
remove the check and change the return type to void.
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/subr_localcount.c10
-rw-r--r--sys/sys/localcount.h4
2 files changed, 5 insertions, 9 deletions
diff --git a/sys/kern/subr_localcount.c b/sys/kern/subr_localcount.c
index c5a279279c2..44eb2ce25cd 100644
--- a/sys/kern/subr_localcount.c
+++ b/sys/kern/subr_localcount.c
@@ -1,4 +1,4 @@
-/* $NetBSD: subr_localcount.c,v 1.3 2017/05/19 02:20:24 pgoyette Exp $ */
+/* $NetBSD: subr_localcount.c,v 1.4 2017/06/02 00:32:12 chs Exp $ */
/*-
* Copyright (c) 2016 The NetBSD Foundation, Inc.
@@ -44,7 +44,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: subr_localcount.c,v 1.3 2017/05/19 02:20:24 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_localcount.c,v 1.4 2017/06/02 00:32:12 chs Exp $");
#include <sys/param.h>
#include <sys/localcount.h>
@@ -66,16 +66,12 @@ __KERNEL_RCSID(0, "$NetBSD: subr_localcount.c,v 1.3 2017/05/19 02:20:24 pgoyette
*/
static void localcount_xc(void *, void *);
-int
+void
localcount_init(struct localcount *lc)
{
lc->lc_totalp = NULL;
lc->lc_percpu = percpu_alloc(sizeof(int64_t));
- if (lc->lc_percpu == NULL)
- return ENOMEM;
-
- return 0;
}
/*
diff --git a/sys/sys/localcount.h b/sys/sys/localcount.h
index c77fc6553c8..6a301197e95 100644
--- a/sys/sys/localcount.h
+++ b/sys/sys/localcount.h
@@ -1,4 +1,4 @@
-/* $NetBSD: localcount.h,v 1.3 2017/05/19 11:45:40 pgoyette Exp $ */
+/* $NetBSD: localcount.h,v 1.4 2017/06/02 00:32:12 chs Exp $ */
/*-
* Copyright (c) 2016 The NetBSD Foundation, Inc.
@@ -47,7 +47,7 @@ struct localcount {
struct percpu *lc_percpu; /* int64_t */
};
-int localcount_init(struct localcount *);
+void localcount_init(struct localcount *);
void localcount_drain(struct localcount *, struct kcondvar *,
struct kmutex *);
void localcount_fini(struct localcount *);