diff options
author | 2011-04-06 13:46:50 +0000 | |
---|---|---|
committer | 2011-04-06 13:46:50 +0000 | |
commit | 32d9261d0d5469554f28a8a02747fc2d86e7e643 (patch) | |
tree | a07e5b3e3ec0229d6157cb0dd4dc560a8316cb13 | |
parent | unconditionally print scsi device ids instead of just when mpath is (diff) | |
download | wireguard-openbsd-32d9261d0d5469554f28a8a02747fc2d86e7e643.tar.xz wireguard-openbsd-32d9261d0d5469554f28a8a02747fc2d86e7e643.zip |
The various read*label() have stopped returning error strings for quite
some time, and return errnos instead. Fix or remove out-of-date comments
mentioning the error strings, and make their callers check the return value
against zero, not NULL.
-rw-r--r-- | sys/arch/alpha/alpha/disksubr.c | 4 | ||||
-rw-r--r-- | sys/arch/amd64/amd64/disksubr.c | 13 | ||||
-rw-r--r-- | sys/arch/arm/arm/disksubr.c | 9 | ||||
-rw-r--r-- | sys/arch/aviion/aviion/disksubr.c | 9 | ||||
-rw-r--r-- | sys/arch/hp300/hp300/disksubr.c | 5 | ||||
-rw-r--r-- | sys/arch/hppa/hppa/disksubr.c | 8 | ||||
-rw-r--r-- | sys/arch/hppa64/hppa64/disksubr.c | 8 | ||||
-rw-r--r-- | sys/arch/i386/i386/disksubr.c | 13 | ||||
-rw-r--r-- | sys/arch/landisk/landisk/disksubr.c | 9 | ||||
-rw-r--r-- | sys/arch/loongson/loongson/disksubr.c | 9 | ||||
-rw-r--r-- | sys/arch/luna88k/luna88k/disksubr.c | 8 | ||||
-rw-r--r-- | sys/arch/mac68k/mac68k/disksubr.c | 5 | ||||
-rw-r--r-- | sys/arch/macppc/macppc/disksubr.c | 11 | ||||
-rw-r--r-- | sys/arch/mvme68k/mvme68k/disksubr.c | 4 | ||||
-rw-r--r-- | sys/arch/mvme88k/mvme88k/disksubr.c | 4 | ||||
-rw-r--r-- | sys/arch/mvmeppc/mvmeppc/disksubr.c | 9 | ||||
-rw-r--r-- | sys/arch/octeon/octeon/disksubr.c | 9 | ||||
-rw-r--r-- | sys/arch/sgi/sgi/disksubr.c | 8 | ||||
-rw-r--r-- | sys/arch/socppc/socppc/disksubr.c | 11 | ||||
-rw-r--r-- | sys/arch/sparc/sparc/disksubr.c | 8 | ||||
-rw-r--r-- | sys/arch/sparc64/sparc64/disksubr.c | 7 | ||||
-rw-r--r-- | sys/arch/vax/vax/disksubr.c | 3 |
22 files changed, 55 insertions, 119 deletions
diff --git a/sys/arch/alpha/alpha/disksubr.c b/sys/arch/alpha/alpha/disksubr.c index 4ddad237ccd..ffecd7d5c37 100644 --- a/sys/arch/alpha/alpha/disksubr.c +++ b/sys/arch/alpha/alpha/disksubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: disksubr.c,v 1.95 2011/02/26 13:07:48 krw Exp $ */ +/* $OpenBSD: disksubr.c,v 1.96 2011/04/06 13:46:50 miod Exp $ */ /* $NetBSD: disksubr.c,v 1.21 1996/05/03 19:42:03 christos Exp $ */ /* @@ -45,8 +45,6 @@ * secpercyl, secsize and anything required for a block i/o read * operation in the driver's strategy/start routines * must be filled in before calling us. - * - * Returns null on success and an error string on failure. */ int readdisklabel(dev_t dev, void (*strat)(struct buf *), diff --git a/sys/arch/amd64/amd64/disksubr.c b/sys/arch/amd64/amd64/disksubr.c index 68f45d54b02..4d59842864c 100644 --- a/sys/arch/amd64/amd64/disksubr.c +++ b/sys/arch/amd64/amd64/disksubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: disksubr.c,v 1.58 2011/02/26 13:07:48 krw Exp $ */ +/* $OpenBSD: disksubr.c,v 1.59 2011/04/06 13:46:50 miod Exp $ */ /* $NetBSD: disksubr.c,v 1.21 1996/05/03 19:42:03 christos Exp $ */ /* @@ -50,17 +50,12 @@ * must be filled in before calling us. * * If dos partition table requested, attempt to load it and - * find disklabel inside a DOS partition. Return buffer - * for use in signalling errors if requested. + * find disklabel inside a DOS partition. * * We would like to check if each MBR has a valid DOSMBR_SIGNATURE, but * we cannot because it doesn't always exist. So.. we assume the * MBR is valid. - * - * Returns null on success and an error string on failure. */ -bios_diskinfo_t *bios_getdiskinfo(dev_t dev); - int readdisklabel(dev_t dev, void (*strat)(struct buf *), struct disklabel *lp, int spoofonly) @@ -97,7 +92,7 @@ readdisklabel(dev_t dev, void (*strat)(struct buf *), bp->b_dev = dev; error = readdoslabel(bp, strat, lp, NULL, spoofonly); - if (error == NULL) + if (error == 0) goto done; #if defined(CD9660) @@ -134,7 +129,7 @@ writedisklabel(dev_t dev, void (*strat)(struct buf *), struct disklabel *lp) bp = geteblk((int)lp->d_secsize); bp->b_dev = dev; - if (readdoslabel(bp, strat, lp, &partoff, 1) != NULL) + if (readdoslabel(bp, strat, lp, &partoff, 1) != 0) goto done; /* Read it in, slap the new label in, and write it back out */ diff --git a/sys/arch/arm/arm/disksubr.c b/sys/arch/arm/arm/disksubr.c index e18bb9110c1..3b1bf7d2284 100644 --- a/sys/arch/arm/arm/disksubr.c +++ b/sys/arch/arm/arm/disksubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: disksubr.c,v 1.53 2011/02/26 13:07:48 krw Exp $ */ +/* $OpenBSD: disksubr.c,v 1.54 2011/04/06 13:46:50 miod Exp $ */ /* $NetBSD: disksubr.c,v 1.21 1996/05/03 19:42:03 christos Exp $ */ /* @@ -46,14 +46,11 @@ * must be filled in before calling us. * * If dos partition table requested, attempt to load it and - * find disklabel inside a DOS partition. Return buffer - * for use in signalling errors if requested. + * find disklabel inside a DOS partition. * * We would like to check if each MBR has a valid DOSMBR_SIGNATURE, but * we cannot because it doesn't always exist. So.. we assume the * MBR is valid. - * - * Returns null on success and an error string on failure. */ int readdisklabel(dev_t dev, void (*strat)(struct buf *), @@ -107,7 +104,7 @@ writedisklabel(dev_t dev, void (*strat)(struct buf *), struct disklabel *lp) bp = geteblk((int)lp->d_secsize); bp->b_dev = dev; - if (readdoslabel(bp, strat, lp, &partoff, 1) != NULL) + if (readdoslabel(bp, strat, lp, &partoff, 1) != 0) goto done; /* Read it in, slap the new label in, and write it back out */ diff --git a/sys/arch/aviion/aviion/disksubr.c b/sys/arch/aviion/aviion/disksubr.c index 1a94df31a3a..9d18e9ee082 100644 --- a/sys/arch/aviion/aviion/disksubr.c +++ b/sys/arch/aviion/aviion/disksubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: disksubr.c,v 1.46 2011/02/26 13:07:48 krw Exp $ */ +/* $OpenBSD: disksubr.c,v 1.47 2011/04/06 13:46:50 miod Exp $ */ /* $NetBSD: disksubr.c,v 1.21 1996/05/03 19:42:03 christos Exp $ */ /* @@ -46,14 +46,11 @@ * must be filled in before calling us. * * If dos partition table requested, attempt to load it and - * find disklabel inside a DOS partition. Return buffer - * for use in signalling errors if requested. + * find disklabel inside a DOS partition. * * We would like to check if each MBR has a valid DOSMBR_SIGNATURE, but * we cannot because it doesn't always exist. So.. we assume the * MBR is valid. - * - * Returns null on success and an error string on failure. */ int readdisklabel(dev_t dev, void (*strat)(struct buf *), @@ -107,7 +104,7 @@ writedisklabel(dev_t dev, void (*strat)(struct buf *), struct disklabel *lp) bp = geteblk((int)lp->d_secsize); bp->b_dev = dev; - if (readdoslabel(bp, strat, lp, &partoff, 1) != NULL) + if (readdoslabel(bp, strat, lp, &partoff, 1) != 0) goto done; /* Read it in, slap the new label in, and write it back out */ diff --git a/sys/arch/hp300/hp300/disksubr.c b/sys/arch/hp300/hp300/disksubr.c index 1a0f660dd0d..ed7bfd117b3 100644 --- a/sys/arch/hp300/hp300/disksubr.c +++ b/sys/arch/hp300/hp300/disksubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: disksubr.c,v 1.48 2011/02/26 13:07:48 krw Exp $ */ +/* $OpenBSD: disksubr.c,v 1.49 2011/04/06 13:46:50 miod Exp $ */ /* $NetBSD: disksubr.c,v 1.9 1997/04/01 03:12:13 scottr Exp $ */ /* @@ -46,8 +46,7 @@ * Attempt to read a disk label from a device using the indicated strategy * routine. The label must be partly set up before this: secpercyl and * anything required in the strategy routine (e.g., sector size) must be - * filled in before calling us. Returns null on success and an error - * string on failure. + * filled in before calling us. */ int readdisklabel(dev_t dev, void (*strat)(struct buf *), diff --git a/sys/arch/hppa/hppa/disksubr.c b/sys/arch/hppa/hppa/disksubr.c index 073b34c9d25..cab45670c51 100644 --- a/sys/arch/hppa/hppa/disksubr.c +++ b/sys/arch/hppa/hppa/disksubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: disksubr.c,v 1.77 2011/02/26 13:07:48 krw Exp $ */ +/* $OpenBSD: disksubr.c,v 1.78 2011/04/06 13:46:50 miod Exp $ */ /* * Copyright (c) 1999 Michael Shalayeff @@ -48,8 +48,6 @@ int readliflabel(struct buf *, void (*)(struct buf *), * secpercyl, secsize and anything required for a block i/o read * operation in the driver's strategy/start routines * must be filled in before calling us. - * - * Returns null on success and an error string on failure. */ int readdisklabel(dev_t dev, void (*strat)(struct buf *), @@ -257,8 +255,8 @@ writedisklabel(dev_t dev, void (*strat)(struct buf *), struct disklabel *lp) bp = geteblk((int)lp->d_secsize); bp->b_dev = dev; - if (readliflabel(bp, strat, lp, &partoff, 1) != NULL && - readdoslabel(bp, strat, lp, &partoff, 1) != NULL) + if (readliflabel(bp, strat, lp, &partoff, 1) != 0 && + readdoslabel(bp, strat, lp, &partoff, 1) != 0) goto done; /* Read it in, slap the new label in, and write it back out */ diff --git a/sys/arch/hppa64/hppa64/disksubr.c b/sys/arch/hppa64/hppa64/disksubr.c index a2d204565d1..fb9348507e9 100644 --- a/sys/arch/hppa64/hppa64/disksubr.c +++ b/sys/arch/hppa64/hppa64/disksubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: disksubr.c,v 1.61 2011/02/26 13:07:48 krw Exp $ */ +/* $OpenBSD: disksubr.c,v 1.62 2011/04/06 13:46:50 miod Exp $ */ /* * Copyright (c) 1999 Michael Shalayeff @@ -48,8 +48,6 @@ int readliflabel(struct buf *, void (*)(struct buf *), * secpercyl, secsize and anything required for a block i/o read * operation in the driver's strategy/start routines * must be filled in before calling us. - * - * Returns null on success and an error string on failure. */ int readdisklabel(dev_t dev, void (*strat)(struct buf *), @@ -257,8 +255,8 @@ writedisklabel(dev_t dev, void (*strat)(struct buf *), struct disklabel *lp) bp = geteblk((int)lp->d_secsize); bp->b_dev = dev; - if (readliflabel(bp, strat, lp, &partoff, 1) != NULL && - readdoslabel(bp, strat, lp, &partoff, 1) != NULL) + if (readliflabel(bp, strat, lp, &partoff, 1) != 0 && + readdoslabel(bp, strat, lp, &partoff, 1) != 0) goto done; /* Read it in, slap the new label in, and write it back out */ diff --git a/sys/arch/i386/i386/disksubr.c b/sys/arch/i386/i386/disksubr.c index e68b6a753e7..ece1edc4f20 100644 --- a/sys/arch/i386/i386/disksubr.c +++ b/sys/arch/i386/i386/disksubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: disksubr.c,v 1.100 2011/02/26 13:07:48 krw Exp $ */ +/* $OpenBSD: disksubr.c,v 1.101 2011/04/06 13:46:50 miod Exp $ */ /* $NetBSD: disksubr.c,v 1.21 1996/05/03 19:42:03 christos Exp $ */ /* @@ -41,6 +41,8 @@ #include <machine/biosvar.h> +bios_diskinfo_t *bios_getdiskinfo(dev_t dev); + /* * Attempt to read a disk label from a device * using the indicated strategy routine. @@ -50,17 +52,12 @@ * must be filled in before calling us. * * If dos partition table requested, attempt to load it and - * find disklabel inside a DOS partition. Return buffer - * for use in signalling errors if requested. + * find disklabel inside a DOS partition. * * We would like to check if each MBR has a valid DOSMBR_SIGNATURE, but * we cannot because it doesn't always exist. So.. we assume the * MBR is valid. - * - * Returns null on success and an error string on failure. */ -bios_diskinfo_t *bios_getdiskinfo(dev_t dev); - int readdisklabel(dev_t dev, void (*strat)(struct buf *), struct disklabel *lp, int spoofonly) @@ -135,7 +132,7 @@ writedisklabel(dev_t dev, void (*strat)(struct buf *), struct disklabel *lp) bp = geteblk((int)lp->d_secsize); bp->b_dev = dev; - if (readdoslabel(bp, strat, lp, &partoff, 1) != NULL) + if (readdoslabel(bp, strat, lp, &partoff, 1) != 0) goto done; /* Read it in, slap the new label in, and write it back out */ diff --git a/sys/arch/landisk/landisk/disksubr.c b/sys/arch/landisk/landisk/disksubr.c index 891fc45debc..72d2d077e85 100644 --- a/sys/arch/landisk/landisk/disksubr.c +++ b/sys/arch/landisk/landisk/disksubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: disksubr.c,v 1.41 2011/02/26 13:07:48 krw Exp $ */ +/* $OpenBSD: disksubr.c,v 1.42 2011/04/06 13:46:50 miod Exp $ */ /* $NetBSD: disksubr.c,v 1.21 1996/05/03 19:42:03 christos Exp $ */ /* @@ -46,14 +46,11 @@ * must be filled in before calling us. * * If dos partition table requested, attempt to load it and - * find disklabel inside a DOS partition. Return buffer - * for use in signalling errors if requested. + * find disklabel inside a DOS partition. * * We would like to check if each MBR has a valid DOSMBR_SIGNATURE, but * we cannot because it doesn't always exist. So.. we assume the * MBR is valid. - * - * Returns null on success and an error string on failure. */ int readdisklabel(dev_t dev, void (*strat)(struct buf *), @@ -107,7 +104,7 @@ writedisklabel(dev_t dev, void (*strat)(struct buf *), struct disklabel *lp) bp = geteblk((int)lp->d_secsize); bp->b_dev = dev; - if (readdoslabel(bp, strat, lp, &partoff, 1) != NULL) + if (readdoslabel(bp, strat, lp, &partoff, 1) != 0) goto done; /* Read it in, slap the new label in, and write it back out */ diff --git a/sys/arch/loongson/loongson/disksubr.c b/sys/arch/loongson/loongson/disksubr.c index 47583b11452..30ecf5b5fb2 100644 --- a/sys/arch/loongson/loongson/disksubr.c +++ b/sys/arch/loongson/loongson/disksubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: disksubr.c,v 1.2 2011/02/26 13:07:48 krw Exp $ */ +/* $OpenBSD: disksubr.c,v 1.3 2011/04/06 13:46:50 miod Exp $ */ /* $NetBSD: disksubr.c,v 1.21 1996/05/03 19:42:03 christos Exp $ */ /* @@ -46,14 +46,11 @@ * must be filled in before calling us. * * If dos partition table requested, attempt to load it and - * find disklabel inside a DOS partition. Return buffer - * for use in signalling errors if requested. + * find disklabel inside a DOS partition. * * We would like to check if each MBR has a valid DOSMBR_SIGNATURE, but * we cannot because it doesn't always exist. So.. we assume the * MBR is valid. - * - * Returns null on success and an error string on failure. */ int readdisklabel(dev_t dev, void (*strat)(struct buf *), @@ -107,7 +104,7 @@ writedisklabel(dev_t dev, void (*strat)(struct buf *), struct disklabel *lp) bp = geteblk((int)lp->d_secsize); bp->b_dev = dev; - if (readdoslabel(bp, strat, lp, &partoff, 1) != NULL) + if (readdoslabel(bp, strat, lp, &partoff, 1) != 0) goto done; /* Read it in, slap the new label in, and write it back out */ diff --git a/sys/arch/luna88k/luna88k/disksubr.c b/sys/arch/luna88k/luna88k/disksubr.c index e831c5ce87b..6f26249ace4 100644 --- a/sys/arch/luna88k/luna88k/disksubr.c +++ b/sys/arch/luna88k/luna88k/disksubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: disksubr.c,v 1.47 2011/02/26 13:07:48 krw Exp $ */ +/* $OpenBSD: disksubr.c,v 1.48 2011/04/06 13:46:50 miod Exp $ */ /* $NetBSD: disksubr.c,v 1.12 2002/02/19 17:09:44 wiz Exp $ */ /* @@ -98,10 +98,6 @@ int disklabel_bsd_to_om(struct disklabel *, struct sun_disklabel *); * secpercyl, secsize and anything required for a block i/o read * operation in the driver's strategy/start routines * must be filled in before calling us. - * - * Return buffer for use in signalling errors if requested. - * - * Returns null on success and an error string on failure. */ int readdisklabel(dev_t dev, void (*strat)(struct buf *), @@ -224,7 +220,6 @@ sun_fstypes[8] = { /* * Given a UniOS/ISI disk label, set lp to a BSD disk label. - * Returns NULL on success, else an error string. * * The BSD label is cleared out before this is called. */ @@ -319,7 +314,6 @@ disklabel_om_to_bsd(struct sun_disklabel *sl, struct disklabel *lp) * Given a BSD disk label, update the UniOS disklabel * pointed to by sl with the new info. Note that the * UniOS disklabel may have other info we need to keep. - * Returns zero or error code. */ int disklabel_bsd_to_om(struct disklabel *lp, struct sun_disklabel *sl) diff --git a/sys/arch/mac68k/mac68k/disksubr.c b/sys/arch/mac68k/mac68k/disksubr.c index 73f1f475ded..e8d95fecfb5 100644 --- a/sys/arch/mac68k/mac68k/disksubr.c +++ b/sys/arch/mac68k/mac68k/disksubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: disksubr.c,v 1.60 2011/02/26 13:07:48 krw Exp $ */ +/* $OpenBSD: disksubr.c,v 1.61 2011/04/06 13:46:50 miod Exp $ */ /* $NetBSD: disksubr.c,v 1.22 1997/11/26 04:18:20 briggs Exp $ */ /* @@ -390,8 +390,7 @@ read_mac_label(char *dlbuf, struct disklabel *lp, int spoofonly) * Attempt to read a disk label from a device using the indicated strategy * routine. The label must be partly set up before this: secpercyl and * anything required in the strategy routine (e.g., sector size) must be - * filled in before calling us. Returns null on success and an error - * string on failure. + * filled in before calling us. */ int readdisklabel(dev_t dev, void (*strat)(struct buf *), diff --git a/sys/arch/macppc/macppc/disksubr.c b/sys/arch/macppc/macppc/disksubr.c index 9f831e8cea9..b5468a7ffb9 100644 --- a/sys/arch/macppc/macppc/disksubr.c +++ b/sys/arch/macppc/macppc/disksubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: disksubr.c,v 1.69 2011/02/26 13:07:48 krw Exp $ */ +/* $OpenBSD: disksubr.c,v 1.70 2011/04/06 13:46:50 miod Exp $ */ /* $NetBSD: disksubr.c,v 1.21 1996/05/03 19:42:03 christos Exp $ */ /* @@ -49,14 +49,11 @@ int readdpmelabel(struct buf *, void (*)(struct buf *), * must be filled in before calling us. * * If dos partition table requested, attempt to load it and - * find disklabel inside a DOS partition. Return buffer - * for use in signalling errors if requested. + * find disklabel inside a DOS partition. * * We would like to check if each MBR has a valid DOSMBR_SIGNATURE, but * we cannot because it doesn't always exist. So.. we assume the * MBR is valid. - * - * Returns null on success and an error string on failure. */ int readdisklabel(dev_t dev, void (*strat)(struct buf *), @@ -201,8 +198,8 @@ writedisklabel(dev_t dev, void (*strat)(struct buf *), struct disklabel *lp) bp = geteblk((int)lp->d_secsize); bp->b_dev = dev; - if (readdpmelabel(bp, strat, lp, &partoff, 1) != NULL && - readdoslabel(bp, strat, lp, &partoff, 1) != NULL) + if (readdpmelabel(bp, strat, lp, &partoff, 1) != 0 && + readdoslabel(bp, strat, lp, &partoff, 1) != 0) goto done; /* Read it in, slap the new label in, and write it back out */ diff --git a/sys/arch/mvme68k/mvme68k/disksubr.c b/sys/arch/mvme68k/mvme68k/disksubr.c index c498b944dac..13cf1511680 100644 --- a/sys/arch/mvme68k/mvme68k/disksubr.c +++ b/sys/arch/mvme68k/mvme68k/disksubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: disksubr.c,v 1.69 2011/02/26 13:07:48 krw Exp $ */ +/* $OpenBSD: disksubr.c,v 1.70 2011/04/06 13:46:50 miod Exp $ */ /* * Copyright (c) 1998 Steve Murphree, Jr. * Copyright (c) 1995 Dale Rahn. @@ -42,9 +42,7 @@ int cputobsdlabel(struct disklabel *, struct mvmedisklabel *); * The label must be partly set up before this: * secpercyl and anything required in the strategy routine * (e.g., sector size) must be filled in before calling us. - * Returns NULL on success and an error string on failure. */ - int readdisklabel(dev_t dev, void (*strat)(struct buf *), struct disklabel *lp, int spoofonly) diff --git a/sys/arch/mvme88k/mvme88k/disksubr.c b/sys/arch/mvme88k/mvme88k/disksubr.c index ddbb91266ca..d1e72dd942c 100644 --- a/sys/arch/mvme88k/mvme88k/disksubr.c +++ b/sys/arch/mvme88k/mvme88k/disksubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: disksubr.c,v 1.65 2011/02/26 13:07:48 krw Exp $ */ +/* $OpenBSD: disksubr.c,v 1.66 2011/04/06 13:46:50 miod Exp $ */ /* * Copyright (c) 1998 Steve Murphree, Jr. * Copyright (c) 1995 Dale Rahn. @@ -42,9 +42,7 @@ int cputobsdlabel(struct disklabel *, struct mvmedisklabel *); * The label must be partly set up before this: * secpercyl and anything required in the strategy routine * (e.g., sector size) must be filled in before calling us. - * Returns NULL on success and an error string on failure. */ - int readdisklabel(dev_t dev, void (*strat)(struct buf *), struct disklabel *lp, int spoofonly) diff --git a/sys/arch/mvmeppc/mvmeppc/disksubr.c b/sys/arch/mvmeppc/mvmeppc/disksubr.c index 7311470fc86..b81805964cb 100644 --- a/sys/arch/mvmeppc/mvmeppc/disksubr.c +++ b/sys/arch/mvmeppc/mvmeppc/disksubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: disksubr.c,v 1.59 2011/02/26 13:07:48 krw Exp $ */ +/* $OpenBSD: disksubr.c,v 1.60 2011/04/06 13:46:50 miod Exp $ */ /* $NetBSD: disksubr.c,v 1.21 1996/05/03 19:42:03 christos Exp $ */ /* @@ -46,14 +46,11 @@ * must be filled in before calling us. * * If dos partition table requested, attempt to load it and - * find disklabel inside a DOS partition. Return buffer - * for use in signalling errors if requested. + * find disklabel inside a DOS partition. * * We would like to check if each MBR has a valid DOSMBR_SIGNATURE, but * we cannot because it doesn't always exist. So.. we assume the * MBR is valid. - * - * Returns null on success and an error string on failure. */ int readdisklabel(dev_t dev, void (*strat)(struct buf *), @@ -107,7 +104,7 @@ writedisklabel(dev_t dev, void (*strat)(struct buf *), struct disklabel *lp) bp = geteblk((int)lp->d_secsize); bp->b_dev = dev; - if (readdoslabel(bp, strat, lp, &partoff, 1) != NULL) + if (readdoslabel(bp, strat, lp, &partoff, 1) != 0) goto done; /* Read it in, slap the new label in, and write it back out */ diff --git a/sys/arch/octeon/octeon/disksubr.c b/sys/arch/octeon/octeon/disksubr.c index 47583b11452..30ecf5b5fb2 100644 --- a/sys/arch/octeon/octeon/disksubr.c +++ b/sys/arch/octeon/octeon/disksubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: disksubr.c,v 1.2 2011/02/26 13:07:48 krw Exp $ */ +/* $OpenBSD: disksubr.c,v 1.3 2011/04/06 13:46:50 miod Exp $ */ /* $NetBSD: disksubr.c,v 1.21 1996/05/03 19:42:03 christos Exp $ */ /* @@ -46,14 +46,11 @@ * must be filled in before calling us. * * If dos partition table requested, attempt to load it and - * find disklabel inside a DOS partition. Return buffer - * for use in signalling errors if requested. + * find disklabel inside a DOS partition. * * We would like to check if each MBR has a valid DOSMBR_SIGNATURE, but * we cannot because it doesn't always exist. So.. we assume the * MBR is valid. - * - * Returns null on success and an error string on failure. */ int readdisklabel(dev_t dev, void (*strat)(struct buf *), @@ -107,7 +104,7 @@ writedisklabel(dev_t dev, void (*strat)(struct buf *), struct disklabel *lp) bp = geteblk((int)lp->d_secsize); bp->b_dev = dev; - if (readdoslabel(bp, strat, lp, &partoff, 1) != NULL) + if (readdoslabel(bp, strat, lp, &partoff, 1) != 0) goto done; /* Read it in, slap the new label in, and write it back out */ diff --git a/sys/arch/sgi/sgi/disksubr.c b/sys/arch/sgi/sgi/disksubr.c index cba5c10d1a9..59e01b6b51b 100644 --- a/sys/arch/sgi/sgi/disksubr.c +++ b/sys/arch/sgi/sgi/disksubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: disksubr.c,v 1.20 2011/02/26 13:07:48 krw Exp $ */ +/* $OpenBSD: disksubr.c,v 1.21 2011/04/06 13:46:50 miod Exp $ */ /* * Copyright (c) 1999 Michael Shalayeff @@ -50,8 +50,6 @@ int readsgilabel(struct buf *, void (*)(struct buf *), * secpercyl, secsize and anything required for a block i/o read * operation in the driver's strategy/start routines * must be filled in before calling us. - * - * Returns null on success and an error string on failure. */ int readdisklabel(dev_t dev, void (*strat)(struct buf *), @@ -224,8 +222,8 @@ writedisklabel(dev_t dev, void (*strat)(struct buf *), struct disklabel *lp) bp = geteblk((int)lp->d_secsize); bp->b_dev = dev; - if (readsgilabel(bp, strat, lp, &partoff, 1) != NULL && - readdoslabel(bp, strat, lp, &partoff, 1) != NULL) + if (readsgilabel(bp, strat, lp, &partoff, 1) != 0 && + readdoslabel(bp, strat, lp, &partoff, 1) != 0) goto done; /* Read it in, slap the new label in, and write it back out */ diff --git a/sys/arch/socppc/socppc/disksubr.c b/sys/arch/socppc/socppc/disksubr.c index 672937dd25b..53d62071981 100644 --- a/sys/arch/socppc/socppc/disksubr.c +++ b/sys/arch/socppc/socppc/disksubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: disksubr.c,v 1.12 2011/02/26 13:07:48 krw Exp $ */ +/* $OpenBSD: disksubr.c,v 1.13 2011/04/06 13:46:50 miod Exp $ */ /* $NetBSD: disksubr.c,v 1.21 1996/05/03 19:42:03 christos Exp $ */ /* @@ -49,14 +49,11 @@ int readdpmelabel(struct buf *, void (*)(struct buf *), * must be filled in before calling us. * * If dos partition table requested, attempt to load it and - * find disklabel inside a DOS partition. Return buffer - * for use in signalling errors if requested. + * find disklabel inside a DOS partition. * * We would like to check if each MBR has a valid DOSMBR_SIGNATURE, but * we cannot because it doesn't always exist. So.. we assume the * MBR is valid. - * - * Returns null on success and an error string on failure. */ int readdisklabel(dev_t dev, void (*strat)(struct buf *), @@ -200,8 +197,8 @@ writedisklabel(dev_t dev, void (*strat)(struct buf *), struct disklabel *lp) bp = geteblk((int)lp->d_secsize); bp->b_dev = dev; - if (readdpmelabel(bp, strat, lp, &partoff, 1) != NULL && - readdoslabel(bp, strat, lp, &partoff, 1) != NULL) + if (readdpmelabel(bp, strat, lp, &partoff, 1) != 0 && + readdoslabel(bp, strat, lp, &partoff, 1) != 0) goto done; /* Read it in, slap the new label in, and write it back out */ diff --git a/sys/arch/sparc/sparc/disksubr.c b/sys/arch/sparc/sparc/disksubr.c index 0c12f30702c..5aeee6bcc1d 100644 --- a/sys/arch/sparc/sparc/disksubr.c +++ b/sys/arch/sparc/sparc/disksubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: disksubr.c,v 1.87 2011/02/26 13:07:48 krw Exp $ */ +/* $OpenBSD: disksubr.c,v 1.88 2011/04/06 13:46:50 miod Exp $ */ /* $NetBSD: disksubr.c,v 1.16 1996/04/28 20:25:59 thorpej Exp $ */ /* @@ -61,10 +61,6 @@ extern void cdstrategy(struct buf *); * secpercyl, secsize and anything required for a block i/o read * operation in the driver's strategy/start routines * must be filled in before calling us. - * - * Return buffer for use in signalling errors if requested. - * - * Returns null on success and an error string on failure. */ int readdisklabel(dev_t dev, void (*strat)(struct buf *), @@ -230,7 +226,6 @@ sun_extended_sum(struct sun_disklabel *sl, void *end) /* * Given a SunOS disk label, set lp to a BSD disk label. - * Returns NULL on success, else an error string. * * The BSD label is cleared out before this is called. */ @@ -391,7 +386,6 @@ disklabel_sun_to_bsd(struct sun_disklabel *sl, struct disklabel *lp) * Given a BSD disk label, update the Sun disklabel * pointed to by cp with the new info. Note that the * Sun disklabel may have other info we need to keep. - * Returns zero or error code. */ static int disklabel_bsd_to_sun(struct disklabel *lp, struct sun_disklabel *sl) diff --git a/sys/arch/sparc64/sparc64/disksubr.c b/sys/arch/sparc64/sparc64/disksubr.c index 0cf2b995632..94db5a98104 100644 --- a/sys/arch/sparc64/sparc64/disksubr.c +++ b/sys/arch/sparc64/sparc64/disksubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: disksubr.c,v 1.63 2010/09/08 14:37:32 jsing Exp $ */ +/* $OpenBSD: disksubr.c,v 1.64 2011/04/06 13:46:51 miod Exp $ */ /* $NetBSD: disksubr.c,v 1.13 2000/12/17 22:39:18 pk Exp $ */ /* @@ -54,10 +54,6 @@ extern void cdstrategy(struct buf *); * secpercyl, secsize and anything required for a block i/o read * operation in the driver's strategy/start routines * must be filled in before calling us. - * - * Return buffer for use in signalling errors if requested. - * - * Returns null on success and an error string on failure. */ int readdisklabel(dev_t dev, void (*strat)(struct buf *), @@ -384,7 +380,6 @@ disklabel_sun_to_bsd(struct sun_disklabel *sl, struct disklabel *lp) * Given a BSD disk label, update the Sun disklabel * pointed to by cp with the new info. Note that the * Sun disklabel may have other info we need to keep. - * Returns zero or error code. */ static int disklabel_bsd_to_sun(struct disklabel *lp, struct sun_disklabel *sl) diff --git a/sys/arch/vax/vax/disksubr.c b/sys/arch/vax/vax/disksubr.c index de5ff9d5077..1704f28056f 100644 --- a/sys/arch/vax/vax/disksubr.c +++ b/sys/arch/vax/vax/disksubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: disksubr.c,v 1.62 2011/02/26 13:07:48 krw Exp $ */ +/* $OpenBSD: disksubr.c,v 1.63 2011/04/06 13:46:51 miod Exp $ */ /* $NetBSD: disksubr.c,v 1.21 1999/06/30 18:48:06 ragge Exp $ */ /* @@ -56,7 +56,6 @@ * The label must be partly set up before this: * secpercyl and anything required in the strategy routine * (e.g., sector size) must be filled in before calling us. - * Returns null on success and an error string on failure. */ int readdisklabel(dev_t dev, void (*strat)(struct buf *), |