summaryrefslogtreecommitdiffstats
path: root/sys/kern/subr_disk.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/kern/subr_disk.c')
-rw-r--r--sys/kern/subr_disk.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/sys/kern/subr_disk.c b/sys/kern/subr_disk.c
index fa0587efb52..e0e69d4dc5b 100644
--- a/sys/kern/subr_disk.c
+++ b/sys/kern/subr_disk.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: subr_disk.c,v 1.192 2015/08/28 22:42:05 krw Exp $ */
+/* $OpenBSD: subr_disk.c,v 1.193 2015/08/29 20:48:55 krw Exp $ */
/* $NetBSD: subr_disk.c,v 1.17 1996/03/16 23:17:08 christos Exp $ */
/*
@@ -656,7 +656,6 @@ readgptlabel(struct buf *bp, void (*strat)(struct buf *),
/* read header record */
bp->b_blkno = DL_BLKTOSEC(lp, part_blkno) * DL_BLKSPERSEC(lp);
- offset = DL_BLKOFFSET(lp, part_blkno);
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);
@@ -671,7 +670,7 @@ readgptlabel(struct buf *bp, void (*strat)(struct buf *),
return (error);
}
- bcopy(bp->b_data + offset, &gh, sizeof(gh));
+ bcopy(bp->b_data, &gh, sizeof(gh));
ghsize = letoh32(gh.gh_size);
ghpartsize = letoh32(gh.gh_part_size);
ghpartspersec = lp->d_secsize / ghpartsize;
@@ -745,7 +744,6 @@ readgptlabel(struct buf *bp, void (*strat)(struct buf *),
/* read partition record */
bp->b_blkno = DL_BLKTOSEC(lp, part_blkno) *
DL_BLKSPERSEC(lp);
- offset = DL_BLKOFFSET(lp, part_blkno);
bp->b_bcount = lp->d_secsize;
/* B_ERROR and b_error may have stale data. */
bp->b_error = 0;
@@ -760,7 +758,7 @@ readgptlabel(struct buf *bp, void (*strat)(struct buf *),
return (error);
}
- bcopy(bp->b_data + offset, gp + i * ghpartspersec,
+ bcopy(bp->b_data, gp + i * ghpartspersec,
ghpartspersec * sizeof(struct gpt_partition));
}