From 05e5f9933bb2b8f691e82f28c60cc02d2d6d4d94 Mon Sep 17 00:00:00 2001 From: krw Date: Thu, 15 Sep 2022 09:08:29 +0000 Subject: [PATCH] Remove unneeded interim DPRINTF() verbiage. Make DEBUG compile again. --- sys/kern/subr_disk.c | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/sys/kern/subr_disk.c b/sys/kern/subr_disk.c index a387fdc5529..6931359aeba 100644 --- a/sys/kern/subr_disk.c +++ b/sys/kern/subr_disk.c @@ -1,4 +1,4 @@ -/* $OpenBSD: subr_disk.c,v 1.262 2022/09/11 19:34:40 miod Exp $ */ +/* $OpenBSD: subr_disk.c,v 1.263 2022/09/15 09:08:29 krw Exp $ */ /* $NetBSD: subr_disk.c,v 1.17 1996/03/16 23:17:08 christos Exp $ */ /* @@ -347,13 +347,13 @@ readdoslabel(struct buf *bp, void (*strat)(struct buf *), struct disklabel *lp, major(bp->b_dev), minor(bp->b_dev)); break; } - printf("readdoslabel(new) enter: %s, spoofonly %d, partoffp %sNULL\n", + printf("readdoslabel enter: %s, spoofonly %d, partoffp %sNULL\n", devname, spoofonly, (partoffp == NULL) ? "" : "not "); #endif /* DEBUG */ error = readdisksector(bp, strat, lp, DOSBBSECTOR); if (error) { - DPRINTF("readdoslabel(new) return: %s, %d -- lp unchanged, " + DPRINTF("readdoslabel return: %s, %d -- lp unchanged, " "DOSBBSECTOR read error\n", devname, error); return error; } @@ -372,7 +372,7 @@ readdoslabel(struct buf *bp, void (*strat)(struct buf *), struct disklabel *lp, if (nlp.d_magic != DISKMAGIC) spooffat(dosbb, &nlp, &partoff); if (nlp.d_magic != DISKMAGIC) { - DPRINTF("readdoslabel(new): N/A -- label partition @ " + DPRINTF("readdoslabel: N/A -- label partition @ " "daddr_t 0 (default)\n"); partoff = 0; } @@ -384,12 +384,12 @@ readdoslabel(struct buf *bp, void (*strat)(struct buf *), struct disklabel *lp, * lp is copied into it. So leave lp alone! */ if (partoff == -1) { - DPRINTF("readdoslabel(new) return: %s, ENXIO, lp " + DPRINTF("readdoslabel return: %s, ENXIO, lp " "unchanged, *partoffp unchanged\n", devname); return ENXIO; } *partoffp = partoff; - DPRINTF("readdoslabel(new) return: %s, 0, lp unchanged, " + DPRINTF("readdoslabel return: %s, 0, lp unchanged, " "*partoffp set to %lld\n", devname, *partoffp); return 0; } @@ -400,7 +400,7 @@ readdoslabel(struct buf *bp, void (*strat)(struct buf *), struct disklabel *lp, lp->d_checksum = dkcksum(lp); if (spoofonly || partoff == -1) { - DPRINTF("readdoslabel(new) return: %s, 0, lp spoofed\n", + DPRINTF("readdoslabel return: %s, 0, lp spoofed\n", devname); return 0; } @@ -408,7 +408,7 @@ readdoslabel(struct buf *bp, void (*strat)(struct buf *), struct disklabel *lp, partoff += DOS_LABELSECTOR; error = readdisksector(bp, strat, lp, DL_BLKTOSEC(lp, partoff)); if (error) { - DPRINTF("readdoslabel(new) return: %s, %d, lp read failed\n", + DPRINTF("readdoslabel return: %s, %d, lp read failed\n", devname, error); return bp->b_error; } @@ -416,7 +416,7 @@ readdoslabel(struct buf *bp, void (*strat)(struct buf *), struct disklabel *lp, rlp = (struct disklabel *)(bp->b_data + DL_BLKOFFSET(lp, partoff)); error = checkdisklabel(rlp, lp, DL_GETBSTART(rlp), DL_GETBEND(rlp)); - DPRINTF("readdoslabel(new) return: %s, %d, checkdisklabel() of daddr_t " + DPRINTF("readdoslabel return: %s, %d, checkdisklabel() of daddr_t " "%lld %s\n", devname, error, partoff, error ? "failed" : "ok"); return error; @@ -642,7 +642,8 @@ spoofgpt(struct buf *bp, void (*strat)(struct buf *), const uint8_t *dosbb, obsdfound = 0; for (i = 0; i < partnum; i++) { if (letoh64(gp[i].gp_attrs) & GPTPARTATTR_REQUIRED) { - DPRINTF("spoofgpt: Skipping partition %u (REQUIRED)\n"); + DPRINTF("spoofgpt: Skipping partition %u (REQUIRED)\n", + i); continue; } @@ -690,7 +691,7 @@ spoofgpt(struct buf *bp, void (*strat)(struct buf *), const uint8_t *dosbb, free(gp, M_DEVBUF, gpbytes); #ifdef DEBUG - printf("readdoslabel(new): GPT -- "); + printf("readdoslabel: GPT -- "); if (partoff == -1) printf("no label partition\n"); else if (obsdfound == 0) @@ -828,7 +829,7 @@ spoofmbr(struct buf *bp, void (*strat)(struct buf *), const uint8_t *dosbb, lp->d_magic = DISKMAGIC; *partoffp = partoff; #ifdef DEBUG - printf("readdoslabel(new): MBR -- "); + printf("readdoslabel: MBR -- "); if (partoff == -1) printf("no label partition\n"); else if (obsdfound == 0) @@ -856,7 +857,7 @@ spooffat(const uint8_t *dosbb, struct disklabel *lp, daddr_t *partoffp) lp->d_partitions['i' - 'a'].p_fstype = FS_MSDOS; *partoffp = -1; lp->d_magic = DISKMAGIC; - DPRINTF("readdoslabel(new): FAT -- no label partition\n"); + DPRINTF("readdoslabel: FAT -- no label partition\n"); } } -- 2.20.1