From 59a6c3d4e7eb9fd0df0b862826915daffc6b6485 Mon Sep 17 00:00:00 2001 From: mrg Date: Wed, 27 Jan 1999 10:41:00 +0000 Subject: [PATCH] KNF anality. --- sys/dev/rnd.c | 8 +++++--- sys/dev/rndpool.c | 9 ++++++++- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/sys/dev/rnd.c b/sys/dev/rnd.c index 5dc364c56430..a20ba572d231 100644 --- a/sys/dev/rnd.c +++ b/sys/dev/rnd.c @@ -1,4 +1,4 @@ -/* $NetBSD: rnd.c,v 1.11 1998/05/27 00:59:14 explorer Exp $ */ +/* $NetBSD: rnd.c,v 1.12 1999/01/27 10:41:00 mrg Exp $ */ /*- * Copyright (c) 1997 The NetBSD Foundation, Inc. @@ -250,6 +250,7 @@ void rndattach(num) int num; { + rnd_init(); } @@ -259,6 +260,7 @@ rndopen(dev, flags, ifmt, p) int flags, ifmt; struct proc *p; { + if (rnd_ready == 0) return (ENXIO); @@ -274,6 +276,7 @@ rndclose(dev, flags, ifmt, p) int flags, ifmt; struct proc *p; { + return (0); } @@ -624,7 +627,7 @@ rndpoll(dev, events, p) u_int32_t entcnt; /* - * we are always writable + * we are always writable */ revents = events & (POLLOUT | POLLWRNORM); @@ -938,4 +941,3 @@ rnd_extract_data(p, len, flags) return retval; } - diff --git a/sys/dev/rndpool.c b/sys/dev/rndpool.c index 52f1c6037206..97932b4cbd4c 100644 --- a/sys/dev/rndpool.c +++ b/sys/dev/rndpool.c @@ -1,4 +1,4 @@ -/* $NetBSD: rndpool.c,v 1.7 1998/05/27 01:29:13 explorer Exp $ */ +/* $NetBSD: rndpool.c,v 1.8 1999/01/27 10:41:01 mrg Exp $ */ /*- * Copyright (c) 1997 The NetBSD Foundation, Inc. @@ -59,6 +59,7 @@ void rndpool_init(rp) rndpool_t *rp; { + rp->cursor = RND_POOLWORDS - 1; rp->entropy = 0; rp->rotate = 0; @@ -68,6 +69,7 @@ u_int32_t rndpool_get_entropy_count(rp) rndpool_t *rp; { + return rp->entropy; } @@ -76,6 +78,7 @@ rndpool_set_entropy_count(rp, entropy) rndpool_t *rp; u_int32_t entropy; { + rp->entropy = entropy; if (rp->entropy > RND_POOLBITS) rp->entropy = RND_POOLBITS; @@ -86,6 +89,7 @@ rndpool_increment_entropy_count(rp, entropy) rndpool_t *rp; u_int32_t entropy; { + rp->entropy += entropy; if (rp->entropy > RND_POOLBITS) rp->entropy = RND_POOLBITS; @@ -95,12 +99,14 @@ u_int32_t * rndpool_get_pool(rp) rndpool_t *rp; { + return (rp->pool); } u_int32_t rndpool_get_poolsize(void) { + return (RND_POOLWORDS); } @@ -112,6 +118,7 @@ rndpool_add_one_word(rp, val) rndpool_t *rp; u_int32_t val; { + /* * Steal some values out of the pool, and xor them into the * word we were given.