diff options
author | 2015-08-31 14:02:36 +0000 | |
---|---|---|
committer | 2015-08-31 14:02:36 +0000 | |
commit | 042d47b5dae2eb48fc3d9407c20762dda886945b (patch) | |
tree | a18f83ab1e4eead116a49039f26802efa8a6715f /sys/kern/subr_disk.c | |
parent | Forgot to commit the man page bits when removing RH0 support. (diff) | |
download | wireguard-openbsd-042d47b5dae2eb48fc3d9407c20762dda886945b.tar.xz wireguard-openbsd-042d47b5dae2eb48fc3d9407c20762dda886945b.zip |
Rejig the the expression calculating of the address of the disk
sector containing the disklabel, eliminating an unnecessary " *
DL_BLKSPERSEC()".
Tested by bmercer@ as part of larger diff.
Idea from & reads ok to jsing@. ok kettenis@.
Diffstat (limited to 'sys/kern/subr_disk.c')
-rw-r--r-- | sys/kern/subr_disk.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/kern/subr_disk.c b/sys/kern/subr_disk.c index 49b14699041..b0ba7504eba 100644 --- a/sys/kern/subr_disk.c +++ b/sys/kern/subr_disk.c @@ -1,4 +1,4 @@ -/* $OpenBSD: subr_disk.c,v 1.195 2015/08/30 17:19:51 krw Exp $ */ +/* $OpenBSD: subr_disk.c,v 1.196 2015/08/31 14:02:36 krw Exp $ */ /* $NetBSD: subr_disk.c,v 1.17 1996/03/16 23:17:08 christos Exp $ */ /* @@ -526,8 +526,8 @@ notfat: if (spoofonly) return (0); - bp->b_blkno = DL_BLKTOSEC(lp, DL_SECTOBLK(lp, dospartoff) + - DOS_LABELSECTOR) * DL_BLKSPERSEC(lp); + bp->b_blkno = DL_SECTOBLK(lp, dospartoff + DL_BLKTOSEC(lp, + DOS_LABELSECTOR)); bp->b_bcount = lp->d_secsize; bp->b_error = 0; /* B_ERROR and b_error may have stale data. */ CLR(bp->b_flags, B_READ | B_WRITE | B_DONE | B_ERROR); @@ -840,8 +840,8 @@ readgptlabel(struct buf *bp, void (*strat)(struct buf *), if (spoofonly) return (0); - bp->b_blkno = DL_BLKTOSEC(lp, DL_SECTOBLK(lp, gptpartoff) + - DOS_LABELSECTOR) * DL_BLKSPERSEC(lp); + bp->b_blkno = DL_SECTOBLK(lp, gptpartoff + DL_BLKTOSEC(lp, + DOS_LABELSECTOR)); bp->b_bcount = lp->d_secsize; bp->b_error = 0; /* B_ERROR and b_error may have stale data. */ CLR(bp->b_flags, B_READ | B_WRITE | B_DONE | B_ERROR); |