summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorJasper Lievisse Adriaanse <jasper@cvs.openbsd.org>2014-07-22 14:49:50 +0000
committerJasper Lievisse Adriaanse <jasper@cvs.openbsd.org>2014-07-22 14:49:50 +0000
commit7bef3039f556cbb2ec364bab64d25a253cfd152f (patch)
treeb40bd6711d9a1023ae2d1d7c4454f48f126c7180 /sys/arch
parent086c3663c82485bb9211456bf9fac74d53bae08d (diff)
- use DL_SECTOBLK() instead of handrolling the same functionality
- octcfsize() returns daddr_t, so calculate the return value in a daddr_t
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/octeon/dev/octcf.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/arch/octeon/dev/octcf.c b/sys/arch/octeon/dev/octcf.c
index 741a735dcc5..42087e7f09d 100644
--- a/sys/arch/octeon/dev/octcf.c
+++ b/sys/arch/octeon/dev/octcf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: octcf.c,v 1.20 2014/07/22 14:45:34 jasper Exp $ */
+/* $OpenBSD: octcf.c,v 1.21 2014/07/22 14:49:49 jasper Exp $ */
/* $NetBSD: wd.c,v 1.193 1999/02/28 17:15:27 explorer Exp $ */
/*
@@ -366,7 +366,6 @@ _octcfstart(struct octcf_softc *wd, struct buf *bp)
secno = DL_BLKTOSEC(lp, bp->b_blkno) +
DL_GETPOFFSET(&lp->d_partitions[DISKPART(bp->b_dev)]);
nsecs = howmany(bp->b_bcount, lp->d_secsize);
-
wd->sc_bp = bp;
/* Instrumentation. */
@@ -656,8 +655,9 @@ daddr_t
octcfsize(dev_t dev)
{
struct octcf_softc *wd;
+ struct disklabel *lp;
int part, omask;
- int64_t size;
+ daddr_t size;
OCTCFDEBUG_PRINT(("%s\n", __func__), DEBUG_FUNCS);
@@ -673,8 +673,8 @@ octcfsize(dev_t dev)
goto exit;
}
- size = DL_GETPSIZE(&wd->sc_dk.dk_label->d_partitions[part]) *
- (wd->sc_dk.dk_label->d_secsize / DEV_BSIZE);
+ lp = wd->sc_dk.dk_label;
+ size = DL_SECTOBLK(lp, DL_GETPSIZE(&lp->d_partitions[part]));
if (omask == 0 && octcfclose(dev, 0, S_IFBLK, NULL) != 0)
size = -1;