diff options
Diffstat (limited to 'sys/arch/macppc/stand/ofdev.c')
-rw-r--r-- | sys/arch/macppc/stand/ofdev.c | 43 |
1 files changed, 23 insertions, 20 deletions
diff --git a/sys/arch/macppc/stand/ofdev.c b/sys/arch/macppc/stand/ofdev.c index 5ded35dea90..bd7830d8b17 100644 --- a/sys/arch/macppc/stand/ofdev.c +++ b/sys/arch/macppc/stand/ofdev.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ofdev.c,v 1.5 2002/09/15 02:02:44 deraadt Exp $ */ +/* $OpenBSD: ofdev.c,v 1.6 2002/09/15 09:01:59 deraadt Exp $ */ /* $NetBSD: ofdev.c,v 1.1 1997/04/16 20:29:20 thorpej Exp $ */ /* @@ -204,8 +204,9 @@ read_mac_label(devp, buf, lp) int i; char *s; - if (strategy(devp, F_READ, 1, DEV_BSIZE, buf, &read) != 0 || - read != DEV_BSIZE) { + if ((strategy(devp, F_READ, 1, DEV_BSIZE, buf, &read) != 0) + || (read != DEV_BSIZE)) + { return ERDLAB; } part = (struct part_map_entry *)buf; @@ -224,8 +225,9 @@ read_mac_label(devp, buf, lp) */ for (i = 0; i < part_cnt; i++) { /* read the appropriate block */ - if (strategy(devp, F_READ, 1+i, DEV_BSIZE, buf, &read) != 0 || - read != DEV_BSIZE) { + if ((strategy(devp, F_READ, 1+i, DEV_BSIZE, buf, &read) != 0) + || (read != DEV_BSIZE)) + { return ERDLAB; } part = (struct part_map_entry *)buf; @@ -236,9 +238,10 @@ read_mac_label(devp, buf, lp) if (0 == strcmp(part->pmPartType, PART_TYPE_OPENBSD)) { /* FOUND OUR PARTITION!!! */ printf("found OpenBSD DPME partition\n"); - if (strategy(devp, F_READ, part->pmPyPartStart, - DEV_BSIZE, buf, &read) == 0 && - read == DEV_BSIZE) { + if(strategy(devp, F_READ, part->pmPyPartStart, + DEV_BSIZE, buf, &read) == 0 + && read == DEV_BSIZE) + { if (!getdisklabel(buf, lp)) { return 0; } @@ -275,8 +278,8 @@ search_label(devp, off, buf, lp, off0) u_long poff; static int recursion; - if (strategy(devp, F_READ, off, DEV_BSIZE, buf, &read) || - read != DEV_BSIZE) + if (strategy(devp, F_READ, off, DEV_BSIZE, buf, &read) + || read != DEV_BSIZE) return ERDLAB; if (buf[510] != 0x55 || buf[511] != 0xaa) @@ -285,20 +288,20 @@ search_label(devp, off, buf, lp, off0) if (recursion++ <= 1) off0 += off; for (p = (struct dos_partition *)(buf + DOSPARTOFF), i = 4; - --i >= 0; p++) { + --i >= 0; p++) { if (p->dp_typ == DOSPTYP_OPENBSD || p->dp_typ == DOSPTYP_NETBSD) { poff = get_long(&p->dp_start) + off0; if (strategy(devp, F_READ, poff + LABELSECTOR, - DEV_BSIZE, buf, &read) == 0 && - read == DEV_BSIZE) { + DEV_BSIZE, buf, &read) == 0 + && read == DEV_BSIZE) { if (!getdisklabel(buf, lp)) { recursion--; return 0; } } - if (strategy(devp, F_READ, off, DEV_BSIZE, buf, &read) || - read != DEV_BSIZE) { + if (strategy(devp, F_READ, off, DEV_BSIZE, buf, &read) + || read != DEV_BSIZE) { recursion--; return ERDLAB; } @@ -308,8 +311,8 @@ search_label(devp, off, buf, lp, off0) recursion--; return 0; } - if (strategy(devp, F_READ, off, DEV_BSIZE, buf, &read) || - read != DEV_BSIZE) { + if (strategy(devp, F_READ, off, DEV_BSIZE, buf, &read) + || read != DEV_BSIZE) { recursion--; return ERDLAB; } @@ -382,9 +385,9 @@ devopen(of, name, file) ofdev.bsize = DEV_BSIZE; /* First try to find a disklabel without MBR partitions */ if (strategy(&ofdev, F_READ, - LABELSECTOR, DEV_BSIZE, buf, &read) != 0 || - read != DEV_BSIZE || - getdisklabel(buf, &label)) { + LABELSECTOR, DEV_BSIZE, buf, &read) != 0 + || read != DEV_BSIZE + || getdisklabel(buf, &label)) { /* Else try MBR partitions */ error = read_mac_label(&ofdev, buf, &label); if (error == ERDLAB) { |