summaryrefslogtreecommitdiffstats
path: root/sys/dev/flash.c
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2007-06-07 05:29:43 +0000
committerderaadt <deraadt@openbsd.org>2007-06-07 05:29:43 +0000
commit9683e96e654a4094816afedc21af3e2184b8c6b3 (patch)
tree4ffaa8e918f12ef8f7025db8df0d3c7576aa4b67 /sys/dev/flash.c
parentmore XXsize() functions not fixed (diff)
downloadwireguard-openbsd-9683e96e654a4094816afedc21af3e2184b8c6b3.tar.xz
wireguard-openbsd-9683e96e654a4094816afedc21af3e2184b8c6b3.zip
in OpenBSD as all old BSD unix, RAW_PART always starts at 0, so no
need for special case code; ok krw
Diffstat (limited to 'sys/dev/flash.c')
-rw-r--r--sys/dev/flash.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/sys/dev/flash.c b/sys/dev/flash.c
index bdc1c6650f5..3f1ff5b4b62 100644
--- a/sys/dev/flash.c
+++ b/sys/dev/flash.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: flash.c,v 1.5 2007/06/06 17:15:13 deraadt Exp $ */
+/* $OpenBSD: flash.c,v 1.6 2007/06/07 05:29:43 deraadt Exp $ */
/*
* Copyright (c) 2005 Uwe Stuehler <uwe@openbsd.org>
@@ -904,12 +904,8 @@ _flashstart(struct flash_softc *sc, struct buf *bp)
long pgno;
part = flashpart(bp->b_dev);
- if (part != RAW_PART)
- offset = DL_GETPOFFSET(&sc->sc_dk.dk_label->d_partitions[part]);
- else
- offset = 0;
-
- offset = offset + bp->b_blkno;
+ offset = DL_GETPOFFSET(&sc->sc_dk.dk_label->d_partitions[part]) +
+ bp->b_blkno;
pgno = offset / (sc->sc_flashdev->pagesize / DEV_BSIZE);
/*