summaryrefslogtreecommitdiff
path: root/sys/arch/mvme88k
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2007-05-31 22:06:04 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2007-05-31 22:06:04 +0000
commit7ba43246d7656e2cd061f11f30091e6d3821fc3c (patch)
tree538bd89edb30b239823bea9f36487687c0bb5991 /sys/arch/mvme88k
parent64b6e1f42416eed2e377df185f68116b4515116b (diff)
Minor bounds_check_with_label nits.
1) Use local variable 'labelsector' not 'labelsect' to be consistant (hp300, mac68k, mvme68k, mvme88k, vax). 2) Having checked for sz == 0, the next check needs only be sz < 0, not <= 0. (mac68k, mvme68k, mvme88k) 3) Use lp->d_partitions + DISKPART(dev), rather than lp->d_partitions[DISKPART(dev)] (hp300). Assuming no typos there should be no functional change.
Diffstat (limited to 'sys/arch/mvme88k')
-rw-r--r--sys/arch/mvme88k/mvme88k/disksubr.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/arch/mvme88k/mvme88k/disksubr.c b/sys/arch/mvme88k/mvme88k/disksubr.c
index 6a7209fa9a6..c888d4146f1 100644
--- a/sys/arch/mvme88k/mvme88k/disksubr.c
+++ b/sys/arch/mvme88k/mvme88k/disksubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: disksubr.c,v 1.36 2007/05/31 19:57:44 krw Exp $ */
+/* $OpenBSD: disksubr.c,v 1.37 2007/05/31 22:06:03 krw Exp $ */
/*
* Copyright (c) 1998 Steve Murphree, Jr.
* Copyright (c) 1995 Dale Rahn.
@@ -297,7 +297,7 @@ bounds_check_with_label(struct buf *bp, struct disklabel *lp,
{
#define blockpersec(count, lp) ((count) * (((lp)->d_secsize) / DEV_BSIZE))
struct partition *p = lp->d_partitions + DISKPART(bp->b_dev);
- int labelsect = blockpersec(lp->d_partitions[0].p_offset, lp) +
+ int labelsector = blockpersec(lp->d_partitions[0].p_offset, lp) +
LABELSECTOR;
int sz = howmany(bp->b_bcount, DEV_BSIZE);
@@ -309,9 +309,9 @@ bounds_check_with_label(struct buf *bp, struct disklabel *lp,
/* overwriting disk label ? */
/* XXX should also protect bootstrap in first 8K */
- if (bp->b_blkno + blockpersec(p->p_offset, lp) <= labelsect &&
+ if (bp->b_blkno + blockpersec(p->p_offset, lp) <= labelsector &&
#if LABELSECTOR != 0
- bp->b_blkno + blockpersec(p->p_offset, lp) + sz > labelsect &&
+ bp->b_blkno + blockpersec(p->p_offset, lp) + sz > labelsector &&
#endif
(bp->b_flags & B_READ) == 0 && wlabel == 0) {
bp->b_error = EROFS;
@@ -326,7 +326,7 @@ bounds_check_with_label(struct buf *bp, struct disklabel *lp,
bp->b_resid = bp->b_bcount;
return(0);
}
- if (sz <= 0) {
+ if (sz < 0) {
/* If past end of disk, return EINVAL. */
bp->b_error = EINVAL;
goto bad;