Source-Changes-HG archive

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

[src/trunk]: src/sys/dev eliminate sc_size and fix printf formats



details:   https://anonhg.NetBSD.org/src/rev/0fea5827c23a
branches:  trunk
changeset: 787031:0fea5827c23a
user:      christos <christos%NetBSD.org@localhost>
date:      Wed May 29 23:37:10 2013 +0000

description:
eliminate sc_size and fix printf formats

diffstat:

 sys/dev/dksubr.c |  19 ++++++++++---------
 1 files changed, 10 insertions(+), 9 deletions(-)

diffs (59 lines):

diff -r a3e8f7261a0c -r 0fea5827c23a sys/dev/dksubr.c
--- a/sys/dev/dksubr.c  Wed May 29 23:29:44 2013 +0000
+++ b/sys/dev/dksubr.c  Wed May 29 23:37:10 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dksubr.c,v 1.47 2013/05/29 23:25:55 christos Exp $ */
+/* $NetBSD: dksubr.c,v 1.48 2013/05/29 23:37:10 christos Exp $ */
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 1999, 2002, 2008 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dksubr.c,v 1.47 2013/05/29 23:25:55 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dksubr.c,v 1.48 2013/05/29 23:37:10 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -567,7 +567,7 @@
        lp->d_flags = 0;
 
        lp->d_partitions[RAW_PART].p_offset = 0;
-       lp->d_partitions[RAW_PART].p_size = dksc->sc_size;
+       lp->d_partitions[RAW_PART].p_size = dg->dg_secperunit;
        lp->d_partitions[RAW_PART].p_fstype = FS_UNUSED;
        lp->d_npartitions = RAW_PART + 1;
 
@@ -582,6 +582,7 @@
 {
        struct   disklabel *lp = dksc->sc_dkdev.dk_label;
        struct   cpu_disklabel *clp = dksc->sc_dkdev.dk_cpulabel;
+       struct disk_geom *dg = &dksc->sc_dkdev.dk_geom;
        struct   partition *pp;
        int      i;
        const char      *errstring;
@@ -601,17 +602,17 @@
                return;
 
        /* Sanity check */
-       if (lp->d_secperunit != dksc->sc_size)
+       if (lp->d_secperunit != dg->dg_secperunit)
                printf("WARNING: %s: total sector size in disklabel (%d) "
-                   "!= the size of %s (%lu)\n", dksc->sc_xname,
-                   lp->d_secperunit, di->di_dkname, (u_long)dksc->sc_size);
+                   "!= the size of %s (%" PRId64 ")\n", dksc->sc_xname,
+                   lp->d_secperunit, di->di_dkname, dg->dg_secperunit);
 
        for (i=0; i < lp->d_npartitions; i++) {
                pp = &lp->d_partitions[i];
-               if (pp->p_offset + pp->p_size > dksc->sc_size)
+               if (pp->p_offset + pp->p_size > dg->dg_secperunit)
                        printf("WARNING: %s: end of partition `%c' exceeds "
-                           "the size of %s (%lu)\n", dksc->sc_xname,
-                           'a' + i, di->di_dkname, (u_long)dksc->sc_size);
+                           "the size of %s (%" PRId64 ")\n", dksc->sc_xname,
+                           'a' + i, di->di_dkname, dg->dg_secperunit);
        }
 }
 



Home | Main Index | Thread Index | Old Index