Source-Changes-HG archive

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

[src/trunk]: src/sys/dev explain why the int cast works (suggested by kre)



details:   https://anonhg.NetBSD.org/src/rev/24e93dbe1fc1
branches:  trunk
changeset: 811659:24e93dbe1fc1
user:      christos <christos%NetBSD.org@localhost>
date:      Mon Nov 09 17:52:59 2015 +0000

description:
explain why the int cast works (suggested by kre)

diffstat:

 sys/dev/vnd.c |  5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diffs (26 lines):

diff -r 4baaa7646c46 -r 24e93dbe1fc1 sys/dev/vnd.c
--- a/sys/dev/vnd.c     Mon Nov 09 17:41:24 2015 +0000
+++ b/sys/dev/vnd.c     Mon Nov 09 17:52:59 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vnd.c,v 1.251 2015/11/09 17:41:24 christos Exp $       */
+/*     $NetBSD: vnd.c,v 1.252 2015/11/09 17:52:59 christos Exp $       */
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2008 The NetBSD Foundation, Inc.
@@ -91,7 +91,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vnd.c,v 1.251 2015/11/09 17:41:24 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vnd.c,v 1.252 2015/11/09 17:52:59 christos Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_vnd.h"
@@ -1068,6 +1068,7 @@
 
        KASSERT(l);
 
+       /* the first member is always int vnd_unit in all the versions */
        if (*(int *)data >= vnd_cd.cd_ndevs)
                return ENXIO;
 



Home | Main Index | Thread Index | Old Index