git: 72ef847c171f - stable/13 - makefs: use %s and __func__ in printf messages

From: Ed Maste <emaste_at_FreeBSD.org>
Date: Fri, 14 Apr 2023 12:53:00 UTC
The branch stable/13 has been updated by emaste:

URL: https://cgit.FreeBSD.org/src/commit/?id=72ef847c171f175c7e0a6da5aa31497fe42d4f6d

commit 72ef847c171f175c7e0a6da5aa31497fe42d4f6d
Author:     Ed Maste <emaste@FreeBSD.org>
AuthorDate: 2023-04-11 15:19:06 +0000
Commit:     Ed Maste <emaste@FreeBSD.org>
CommitDate: 2023-04-14 12:10:38 +0000

    makefs: use %s and __func__ in printf messages
    
    For diff reduction against NetBSD.
    
    Obtained from:  NetBSD 0c4125e1a19f
    Sponsored by:   The FreeBSD Foundation
    
    (cherry picked from commit af7624ed314574d6da1eb45b9fddbd2ad503fea4)
---
 usr.sbin/makefs/ffs/buf.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/usr.sbin/makefs/ffs/buf.c b/usr.sbin/makefs/ffs/buf.c
index bc91df0b3ed3..11b7c4b0f1f8 100644
--- a/usr.sbin/makefs/ffs/buf.c
+++ b/usr.sbin/makefs/ffs/buf.c
@@ -132,14 +132,14 @@ bwrite(struct buf *bp)
 	assert (bp != NULL);
 	offset = (off_t)bp->b_blkno * fs->sectorsize + fs->offset;
 	if (debug & DEBUG_BUF_BWRITE)
-		printf("bwrite: blkno %lld offset %lld bcount %ld\n",
+		printf("%s: blkno %lld offset %lld bcount %ld\n", __func__,
 		    (long long)bp->b_blkno, (long long) offset,
 		    bp->b_bcount);
 	if (lseek(bp->b_fs->fd, offset, SEEK_SET) == -1)
 		return (errno);
 	rv = write(bp->b_fs->fd, bp->b_data, bp->b_bcount);
 	if (debug & DEBUG_BUF_BWRITE)
-		printf("bwrite: write %ld (offset %lld) returned %lld\n",
+		printf("%s: write %ld (offset %lld) returned %lld\n", __func__,
 		    bp->b_bcount, (long long)offset, (long long)rv);
 	if (rv == bp->b_bcount)
 		return (0);
@@ -163,13 +163,13 @@ bcleanup(void)
 	if (TAILQ_EMPTY(&buftail))
 		return;
 
-	printf("bcleanup: unflushed buffers:\n");
+	printf("%s: unflushed buffers:\n", __func__);
 	TAILQ_FOREACH(bp, &buftail, b_tailq) {
 		printf("\tlblkno %10lld  blkno %10lld  count %6ld  bufsize %6ld\n",
 		    (long long)bp->b_lblkno, (long long)bp->b_blkno,
 		    bp->b_bcount, bp->b_bufsize);
 	}
-	printf("bcleanup: done\n");
+	printf("%s: done\n", __func__);
 }
 
 struct buf *
@@ -181,12 +181,13 @@ getblk(struct vnode *vp, daddr_t blkno, int size, int u1 __unused,
 	void *n;
 
 	if (debug & DEBUG_BUF_GETBLK)
-		printf("getblk: blkno %lld size %d\n", (long long)blkno, size);
+		printf("%s: blkno %lld size %d\n", __func__, (long long)blkno,
+		    size);
 
 	bp = NULL;
 	if (!buftailinitted) {
 		if (debug & DEBUG_BUF_GETBLK)
-			printf("getblk: initialising tailq\n");
+			printf("%s: initialising tailq\n", __func__);
 		TAILQ_INIT(&buftail);
 		buftailinitted = 1;
 	} else {