Source-Changes-HG archive

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

[src/trunk]: src/sys/dev Try not to use f_data, use f_rndctx to get a correct...



details:   https://anonhg.NetBSD.org/src/rev/9b0f3b7f805d
branches:  trunk
changeset: 332053:9b0f3b7f805d
user:      matt <matt%NetBSD.org@localhost>
date:      Fri Sep 05 09:23:14 2014 +0000

description:
Try not to use f_data, use f_rndctx to get a correctly typed pointer.

diffstat:

 sys/dev/rndpseudo.c |  16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diffs (68 lines):

diff -r 747d1956805e -r 9b0f3b7f805d sys/dev/rndpseudo.c
--- a/sys/dev/rndpseudo.c       Fri Sep 05 09:20:59 2014 +0000
+++ b/sys/dev/rndpseudo.c       Fri Sep 05 09:23:14 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rndpseudo.c,v 1.21 2014/08/10 16:44:35 tls Exp $       */
+/*     $NetBSD: rndpseudo.c,v 1.22 2014/09/05 09:23:14 matt Exp $      */
 
 /*-
  * Copyright (c) 1997-2013 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rndpseudo.c,v 1.21 2014/08/10 16:44:35 tls Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rndpseudo.c,v 1.22 2014/09/05 09:23:14 matt Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -360,7 +360,7 @@
        if (uio->uio_resid == 0)
                return 0;
 
-       struct rnd_ctx *const ctx = fp->f_data;
+       struct rnd_ctx *const ctx = fp->f_rndctx;
        uint8_t *const buf = pool_cache_get(rnd_temp_buffer_cache, PR_WAITOK);
 
        /*
@@ -817,7 +817,7 @@
 static int
 rnd_poll(struct file *fp, int events)
 {
-       struct rnd_ctx *const ctx = fp->f_data;
+       struct rnd_ctx *const ctx = fp->f_rndctx;
        int revents;
 
        /*
@@ -846,7 +846,7 @@
 static int
 rnd_stat(struct file *fp, struct stat *st)
 {
-       struct rnd_ctx *const ctx = fp->f_data;
+       struct rnd_ctx *const ctx = fp->f_rndctx;
 
        /* XXX lock, if cprng allocated?  why? */
        memset(st, 0, sizeof(*st));
@@ -863,11 +863,11 @@
 static int
 rnd_close(struct file *fp)
 {
-       struct rnd_ctx *const ctx = fp->f_data;
+       struct rnd_ctx *const ctx = fp->f_rndctx;
 
        if (ctx->rc_cprng != NULL)
                cprng_strong_destroy(ctx->rc_cprng);
-       fp->f_data = NULL;
+       fp->f_rndctx = NULL;
        pool_cache_put(rnd_ctx_cache, ctx);
 
        return 0;
@@ -876,7 +876,7 @@
 static int
 rnd_kqfilter(struct file *fp, struct knote *kn)
 {
-       struct rnd_ctx *const ctx = fp->f_data;
+       struct rnd_ctx *const ctx = fp->f_rndctx;
 
        return cprng_strong_kqfilter(rnd_ctx_cprng(ctx), kn);
 }



Home | Main Index | Thread Index | Old Index