Source-Changes-HG archive

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

[src/trunk]: src/sys/kern u_short -> uint16_t, some KNF.



details:   https://anonhg.NetBSD.org/src/rev/647b1f3f6705
branches:  trunk
changeset: 749347:647b1f3f6705
user:      tsutsui <tsutsui%NetBSD.org@localhost>
date:      Fri Nov 27 11:23:50 2009 +0000

description:
u_short -> uint16_t, some KNF.

diffstat:

 sys/kern/subr_disk.c |  15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)

diffs (45 lines):

diff -r 6d758ba79ee2 -r 647b1f3f6705 sys/kern/subr_disk.c
--- a/sys/kern/subr_disk.c      Fri Nov 27 11:16:54 2009 +0000
+++ b/sys/kern/subr_disk.c      Fri Nov 27 11:23:50 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: subr_disk.c,v 1.97 2009/05/20 03:26:21 dyoung Exp $    */
+/*     $NetBSD: subr_disk.c,v 1.98 2009/11/27 11:23:50 tsutsui Exp $   */
 
 /*-
  * Copyright (c) 1996, 1997, 1999, 2000, 2009 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: subr_disk.c,v 1.97 2009/05/20 03:26:21 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_disk.c,v 1.98 2009/11/27 11:23:50 tsutsui Exp $");
 
 #include <sys/param.h>
 #include <sys/kernel.h>
@@ -85,20 +85,21 @@
 u_int
 dkcksum(struct disklabel *lp)
 {
+
        return dkcksum_sized(lp, lp->d_npartitions);
 }
 
 u_int
 dkcksum_sized(struct disklabel *lp, size_t npartitions)
 {
-       u_short *start, *end;
-       u_short sum = 0;
+       uint16_t *start, *end;
+       uint16_t sum = 0;
 
-       start = (u_short *)lp;
-       end = (u_short *)&lp->d_partitions[npartitions];
+       start = (uint16_t *)lp;
+       end = (uint16_t *)&lp->d_partitions[npartitions];
        while (start < end)
                sum ^= *start++;
-       return (sum);
+       return sum;
 }
 
 /*



Home | Main Index | Thread Index | Old Index