eliminate sc_size and fix printf formats

This commit is contained in:
christos 2013-05-29 23:37:10 +00:00
parent ce34c2e6e4
commit bc15abe61d
1 changed files with 10 additions and 9 deletions

View File

@ -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, struct dk_softc *dksc,
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, struct dk_softc *dksc, dev_t dev)
{
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, struct dk_softc *dksc, dev_t dev)
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);
}
}