diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2007-06-06 16:42:08 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2007-06-06 16:42:08 +0000 |
commit | d11216cf36578f6f06482da63b45f1cf02b7ec1d (patch) | |
tree | 008bf85dd65940c398ccaedb1376261a1e08d850 /sys/arch/mvme88k | |
parent | 32d210caa068e883bc0c0c7804fd07bc1fefdcad (diff) |
a fair sprinking of knf, code movement, and sometimes character-by-character
accuracy so that the variious disksubr.c's can be compared easier.
setdisklabel() starts taking an int for openmask.
ok krw, and read by quite a few other people
Diffstat (limited to 'sys/arch/mvme88k')
-rw-r--r-- | sys/arch/mvme88k/mvme88k/disksubr.c | 39 |
1 files changed, 13 insertions, 26 deletions
diff --git a/sys/arch/mvme88k/mvme88k/disksubr.c b/sys/arch/mvme88k/mvme88k/disksubr.c index 0432df2d2c5..9a2a258aa4c 100644 --- a/sys/arch/mvme88k/mvme88k/disksubr.c +++ b/sys/arch/mvme88k/mvme88k/disksubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: disksubr.c,v 1.40 2007/06/05 02:38:37 krw Exp $ */ +/* $OpenBSD: disksubr.c,v 1.41 2007/06/06 16:42:06 deraadt Exp $ */ /* * Copyright (c) 1998 Steve Murphree, Jr. * Copyright (c) 1995 Dale Rahn. @@ -47,12 +47,8 @@ void cputobsdlabel(struct disklabel *, struct cpu_disklabel *); */ char * -readdisklabel(dev, strat, lp, clp, spoofonly) - dev_t dev; - void (*strat)(struct buf *); - struct disklabel *lp; - struct cpu_disklabel *clp; - int spoofonly; +readdisklabel(dev_t dev, void (*strat)(struct buf *), + struct disklabel *lp, struct cpu_disklabel *clp, int spoofonly) { struct buf *bp = NULL; char *msg = NULL; @@ -112,6 +108,7 @@ readdisklabel(dev, strat, lp, clp, spoofonly) goto done; } #endif + if (clp->magic1 != DISKMAGIC || clp->magic2 != DISKMAGIC) { msg = "no disk label"; goto done; @@ -138,10 +135,8 @@ done: * before setting it. */ int -setdisklabel(olp, nlp, openmask, clp) - struct disklabel *olp, *nlp; - u_long openmask; - struct cpu_disklabel *clp; +setdisklabel(struct disklabel *olp, struct disklabel *nlp, + u_int openmask, struct cpu_disklabel *clp) { int i; struct partition *opp, *npp; @@ -161,7 +156,7 @@ setdisklabel(olp, nlp, openmask, clp) dkcksum(nlp) != 0) return (EINVAL); - while ((i = ffs((long)openmask)) != 0) { + while ((i = ffs(openmask)) != 0) { i--; openmask &= ~(1 << i); if (nlp->d_npartitions <= i) @@ -182,8 +177,8 @@ setdisklabel(olp, nlp, openmask, clp) } } - nlp->d_checksum = 0; - nlp->d_checksum = dkcksum(nlp); + nlp->d_checksum = 0; + nlp->d_checksum = dkcksum(nlp); *olp = *nlp; return (0); } @@ -192,11 +187,8 @@ setdisklabel(olp, nlp, openmask, clp) * Write disk label back to device after modification. */ int -writedisklabel(dev, strat, lp, clp) - dev_t dev; - void (*strat)(struct buf *); - struct disklabel *lp; - struct cpu_disklabel *clp; +writedisklabel(dev_t dev, void (*strat)(struct buf *), + struct disklabel *lp, struct cpu_disklabel *clp) { struct buf *bp; int error; @@ -250,7 +242,6 @@ writedisklabel(dev, strat, lp, clp) return (error); } - int bounds_check_with_label(struct buf *bp, struct disklabel *lp, struct cpu_disklabel *osdep, int wlabel) @@ -307,9 +298,7 @@ bad: void -bsdtocpulabel(lp, clp) - struct disklabel *lp; - struct cpu_disklabel *clp; +bsdtocpulabel(struct disklabel *lp, struct cpu_disklabel *clp) { char *tmot = "MOTOROLA"; char *id = "M88K"; @@ -380,9 +369,7 @@ bsdtocpulabel(lp, clp) } void -cputobsdlabel(lp, clp) - struct disklabel *lp; - struct cpu_disklabel *clp; +cputobsdlabel(struct disklabel *lp, struct cpu_disklabel *clp) { int i; |