Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/kern Move a few CTASSERT to global scope
details: https://anonhg.NetBSD.org/src/rev/9bcd8a766b3a
branches: trunk
changeset: 789998:9bcd8a766b3a
user: martin <martin%NetBSD.org@localhost>
date: Sat Sep 14 20:47:48 2013 +0000
description:
Move a few CTASSERT to global scope
diffstat:
sys/kern/kern_rndsink.c | 14 ++++++++------
1 files changed, 8 insertions(+), 6 deletions(-)
diffs (41 lines):
diff -r f39ecb2d2068 -r 9bcd8a766b3a sys/kern/kern_rndsink.c
--- a/sys/kern/kern_rndsink.c Sat Sep 14 20:46:27 2013 +0000
+++ b/sys/kern/kern_rndsink.c Sat Sep 14 20:47:48 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: kern_rndsink.c,v 1.5 2013/08/27 19:30:10 riastradh Exp $ */
+/* $NetBSD: kern_rndsink.c,v 1.6 2013/09/14 20:47:48 martin Exp $ */
/*-
* Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_rndsink.c,v 1.5 2013/08/27 19:30:10 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_rndsink.c,v 1.6 2013/09/14 20:47:48 martin Exp $");
#include <sys/param.h>
#include <sys/types.h>
@@ -118,16 +118,18 @@
* and return true. Otherwise, leave the buffer alone and return
* false.
*/
+
+CTASSERT(RND_ENTROPY_THRESHOLD <= 0xffffffffUL);
+CTASSERT(RNDSINK_MAX_BYTES <= (0xffffffffUL - RND_ENTROPY_THRESHOLD));
+CTASSERT((RNDSINK_MAX_BYTES + RND_ENTROPY_THRESHOLD) <=
+ (0xffffffffUL / NBBY));
+
static bool
rndpool_maybe_extract(void *buffer, size_t bytes)
{
bool ok;
KASSERT(bytes <= RNDSINK_MAX_BYTES);
- CTASSERT(RND_ENTROPY_THRESHOLD <= 0xffffffffUL);
- CTASSERT(RNDSINK_MAX_BYTES <= (0xffffffffUL - RND_ENTROPY_THRESHOLD));
- CTASSERT((RNDSINK_MAX_BYTES + RND_ENTROPY_THRESHOLD) <=
- (0xffffffffUL / NBBY));
const uint32_t bits_needed = ((bytes + RND_ENTROPY_THRESHOLD) * NBBY);
Home |
Main Index |
Thread Index |
Old Index