Module Name: src
Committed By: christos
Date: Wed May 29 23:37:11 UTC 2013
Modified Files:
src/sys/dev: dksubr.c
Log Message:
eliminate sc_size and fix printf formats
To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/sys/dev/dksubr.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/dksubr.c
diff -u src/sys/dev/dksubr.c:1.47 src/sys/dev/dksubr.c:1.48
--- src/sys/dev/dksubr.c:1.47 Wed May 29 19:25:55 2013
+++ src/sys/dev/dksubr.c Wed May 29 19:37:10 2013
@@ -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 @@ dk_getdefaultlabel(struct dk_intf *di, s
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 @@ dk_getdisklabel(struct dk_intf *di, stru
{
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 @@ dk_getdisklabel(struct dk_intf *di, stru
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);
}
}