From 95c7a7e8448aceffb1dc9ab5854db4252b367b90 Mon Sep 17 00:00:00 2001 From: Kenneth R Westerback Date: Sun, 20 Oct 2013 10:11:18 +0000 Subject: (daddr_t) -> (u_int64_t) when multiplying ncylinders * secpercyl to get disk size, since DL_SETDSIZE() takes disk sector values, not 512-byte block values. --- sys/arch/luna88k/luna88k/disksubr.c | 4 ++-- sys/arch/sparc/dev/xd.c | 4 ++-- sys/arch/sparc/dev/xy.c | 4 ++-- sys/arch/sparc/sparc/disksubr.c | 4 ++-- sys/arch/sparc64/dev/fd.c | 4 ++-- sys/arch/sparc64/sparc64/disksubr.c | 4 ++-- sys/arch/sparc64/stand/ofwboot/ofdev.c | 4 ++-- sys/dev/flash.c | 4 ++-- 8 files changed, 16 insertions(+), 16 deletions(-) diff --git a/sys/arch/luna88k/luna88k/disksubr.c b/sys/arch/luna88k/luna88k/disksubr.c index 74eca5615bd..ed83d8a753f 100644 --- a/sys/arch/luna88k/luna88k/disksubr.c +++ b/sys/arch/luna88k/luna88k/disksubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: disksubr.c,v 1.55 2013/08/25 10:50:55 miod Exp $ */ +/* $OpenBSD: disksubr.c,v 1.56 2013/10/20 10:11:16 krw Exp $ */ /* $NetBSD: disksubr.c,v 1.12 2002/02/19 17:09:44 wiz Exp $ */ /* @@ -275,7 +275,7 @@ disklabel_om_to_bsd(struct sun_disklabel *sl, struct disklabel *lp) secpercyl = sl->sl_nsectors * sl->sl_ntracks; lp->d_secpercyl = secpercyl; if (DL_GETDSIZE(lp) == 0) - DL_SETDSIZE(lp, (daddr_t)secpercyl * sl->sl_ncylinders); + DL_SETDSIZE(lp, (u_int64_t)secpercyl * sl->sl_ncylinders); lp->d_version = 1; memcpy(&lp->d_uid, &sl->sl_uid, sizeof(sl->sl_uid)); diff --git a/sys/arch/sparc/dev/xd.c b/sys/arch/sparc/dev/xd.c index f7dd8eba5ad..f16c7bce5e5 100644 --- a/sys/arch/sparc/dev/xd.c +++ b/sys/arch/sparc/dev/xd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xd.c,v 1.59 2013/10/14 23:26:22 krw Exp $ */ +/* $OpenBSD: xd.c,v 1.60 2013/10/20 10:11:16 krw Exp $ */ /* $NetBSD: xd.c,v 1.37 1997/07/29 09:58:16 fair Exp $ */ /* @@ -300,7 +300,7 @@ xdgetdisklabel(xd, b) lp->d_secsize = XDFM_BPS; if (sl->sl_magic == SUN_DKMAGIC) { lp->d_secpercyl = sl->sl_nsectors * sl->sl_ntracks; - DL_SETDSIZE(lp, (daddr_t)lp->d_secpercyl * sl->sl_ncylinders); + DL_SETDSIZE(lp, (u_int64_t)lp->d_secpercyl * sl->sl_ncylinders); } else { lp->d_secpercyl = 1; } diff --git a/sys/arch/sparc/dev/xy.c b/sys/arch/sparc/dev/xy.c index 561079a653e..ba0be46bd01 100644 --- a/sys/arch/sparc/dev/xy.c +++ b/sys/arch/sparc/dev/xy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xy.c,v 1.55 2013/10/14 23:26:22 krw Exp $ */ +/* $OpenBSD: xy.c,v 1.56 2013/10/20 10:11:16 krw Exp $ */ /* $NetBSD: xy.c,v 1.26 1997/07/19 21:43:56 pk Exp $ */ /* @@ -238,7 +238,7 @@ xygetdisklabel(xy, b) lp->d_secsize = XYFM_BPS; if (sl->sl_magic == SUN_DKMAGIC) { lp->d_secpercyl = sl->sl_nsectors * sl->sl_ntracks; - DL_SETDSIZE(lp, (daddr_t)lp->d_secpercyl * sl->sl_ncylinders); + DL_SETDSIZE(lp, (u_int64_t)lp->d_secpercyl * sl->sl_ncylinders); } else { lp->d_secpercyl = 1; } diff --git a/sys/arch/sparc/sparc/disksubr.c b/sys/arch/sparc/sparc/disksubr.c index e4e093f9eb6..05f1cea89fe 100644 --- a/sys/arch/sparc/sparc/disksubr.c +++ b/sys/arch/sparc/sparc/disksubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: disksubr.c,v 1.91 2013/06/11 16:42:11 deraadt Exp $ */ +/* $OpenBSD: disksubr.c,v 1.92 2013/10/20 10:11:16 krw Exp $ */ /* $NetBSD: disksubr.c,v 1.16 1996/04/28 20:25:59 thorpej Exp $ */ /* @@ -263,7 +263,7 @@ disklabel_sun_to_bsd(struct sun_disklabel *sl, struct disklabel *lp) secpercyl = sl->sl_nsectors * sl->sl_ntracks; lp->d_secpercyl = secpercyl; if (DL_GETDSIZE(lp) == 0) - DL_SETDSIZE(lp, (daddr_t)secpercyl * sl->sl_ncylinders); + DL_SETDSIZE(lp, (u_int64_t)secpercyl * sl->sl_ncylinders); lp->d_version = 1; memcpy(&lp->d_uid, &sl->sl_uid, sizeof(sl->sl_uid)); diff --git a/sys/arch/sparc64/dev/fd.c b/sys/arch/sparc64/dev/fd.c index 9bdde9a80fc..3f745b8e7df 100644 --- a/sys/arch/sparc64/dev/fd.c +++ b/sys/arch/sparc64/dev/fd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fd.c,v 1.39 2013/06/11 16:42:12 deraadt Exp $ */ +/* $OpenBSD: fd.c,v 1.40 2013/10/20 10:11:17 krw Exp $ */ /* $NetBSD: fd.c,v 1.112 2003/08/07 16:29:35 agc Exp $ */ /*- @@ -2025,7 +2025,7 @@ fdgetdisklabel(dev_t dev, struct fd_softc *fd, struct disklabel *lp, lp->d_nsectors = fd->sc_type->sectrac; lp->d_ncylinders = fd->sc_type->tracks; lp->d_ntracks = fd->sc_type->heads; /* Go figure... */ - DL_SETDSIZE(lp, (daddr_t)lp->d_secpercyl * lp->d_ncylinders); + DL_SETDSIZE(lp, (u_int64_t)lp->d_secpercyl * lp->d_ncylinders); strncpy(lp->d_typename, "floppy disk", sizeof(lp->d_typename)); strncpy(lp->d_packname, "fictitious", sizeof(lp->d_packname)); diff --git a/sys/arch/sparc64/sparc64/disksubr.c b/sys/arch/sparc64/sparc64/disksubr.c index 38a0725b62a..47828bd497f 100644 --- a/sys/arch/sparc64/sparc64/disksubr.c +++ b/sys/arch/sparc64/sparc64/disksubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: disksubr.c,v 1.67 2013/06/11 16:42:12 deraadt Exp $ */ +/* $OpenBSD: disksubr.c,v 1.68 2013/10/20 10:11:17 krw Exp $ */ /* $NetBSD: disksubr.c,v 1.13 2000/12/17 22:39:18 pk Exp $ */ /* @@ -253,7 +253,7 @@ disklabel_sun_to_bsd(struct sun_disklabel *sl, struct disklabel *lp) secpercyl = sl->sl_nsectors * sl->sl_ntracks; lp->d_secpercyl = secpercyl; if (DL_GETDSIZE(lp) == 0) - DL_SETDSIZE(lp, (daddr_t)secpercyl * sl->sl_ncylinders); + DL_SETDSIZE(lp, (u_int64_t)secpercyl * sl->sl_ncylinders); lp->d_version = 1; memcpy(&lp->d_uid, &sl->sl_uid, sizeof(lp->d_uid)); diff --git a/sys/arch/sparc64/stand/ofwboot/ofdev.c b/sys/arch/sparc64/stand/ofwboot/ofdev.c index 22a86e54568..f02a718c972 100644 --- a/sys/arch/sparc64/stand/ofwboot/ofdev.c +++ b/sys/arch/sparc64/stand/ofwboot/ofdev.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ofdev.c,v 1.18 2013/06/11 16:42:12 deraadt Exp $ */ +/* $OpenBSD: ofdev.c,v 1.19 2013/10/20 10:11:17 krw Exp $ */ /* $NetBSD: ofdev.c,v 1.1 2000/08/20 14:58:41 mrg Exp $ */ /* @@ -272,7 +272,7 @@ disklabel_sun_to_bsd(struct sun_disklabel *sl, struct disklabel *lp) secpercyl = sl->sl_nsectors * sl->sl_ntracks; lp->d_secpercyl = secpercyl; if (DL_GETDSIZE(lp) == 0) - DL_SETDSIZE(lp, (daddr_t)secpercyl * sl->sl_ncylinders); + DL_SETDSIZE(lp, (u_int64_t)secpercyl * sl->sl_ncylinders); lp->d_version = 1; memcpy(&lp->d_uid, &sl->sl_uid, sizeof(lp->d_uid)); diff --git a/sys/dev/flash.c b/sys/dev/flash.c index c3e9aaeebb4..26a3428c083 100644 --- a/sys/dev/flash.c +++ b/sys/dev/flash.c @@ -1,4 +1,4 @@ -/* $OpenBSD: flash.c,v 1.26 2013/06/11 16:42:13 deraadt Exp $ */ +/* $OpenBSD: flash.c,v 1.27 2013/10/20 10:11:17 krw Exp $ */ /* * Copyright (c) 2005 Uwe Stuehler @@ -969,7 +969,7 @@ flashgetdefaultlabel(dev_t dev, struct flash_softc *sc, lp->d_nsectors = sc->sc_flashdev->capacity / lp->d_ntracks / lp->d_ncylinders; lp->d_secpercyl = lp->d_ntracks * lp->d_nsectors; - DL_SETDSIZE(lp, (daddr_t)lp->d_ncylinders * lp->d_secpercyl); + DL_SETDSIZE(lp, (u_int64_t)lp->d_ncylinders * lp->d_secpercyl); lp->d_version = 1; -- cgit v1.2.3