git: 9d95d806691e - main - tunefs: Fix pointer arithmetic

From: Dag-Erling Smørgrav <des_at_FreeBSD.org>
Date: Sat, 11 Apr 2026 19:23:20 UTC
The branch main has been updated by des:

URL: https://cgit.FreeBSD.org/src/commit/?id=9d95d806691e4ef1411c6c3b892d8b774754d724

commit 9d95d806691e4ef1411c6c3b892d8b774754d724
Author:     Dag-Erling Smørgrav <des@FreeBSD.org>
AuthorDate: 2026-04-11 19:23:08 +0000
Commit:     Dag-Erling Smørgrav <des@FreeBSD.org>
CommitDate: 2026-04-11 19:23:08 +0000

    tunefs: Fix pointer arithmetic
    
    While here, remove a bogus const which has been there for years.
    
    MFC after:      1 week
    Reported by:    ivy@
    Fixes:          1b83e8a3f840 ("Constify string pointers.")
    Fixes:          8244dd326265 ("tunefs: Better fix for arm64 alignment issues")
    Reviewed by:    kevans
    Differential Revision:  https://reviews.freebsd.org/D56343
---
 sbin/tunefs/tunefs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sbin/tunefs/tunefs.c b/sbin/tunefs/tunefs.c
index 56160dafce28..f3e9306f8ca1 100644
--- a/sbin/tunefs/tunefs.c
+++ b/sbin/tunefs/tunefs.c
@@ -708,13 +708,13 @@ journal_findfile(void)
 }
 
 static void
-dir_clear_block(const dirblock *block, off_t off)
+dir_clear_block(dirblock *block, off_t off)
 {
 	struct direct *dp;
 
 	for (; off < sblock.fs_bsize; off += DIRBLKSIZ) {
 		assert(off % alignof(struct direct) == 0);
-		dp = (struct direct *)(uintptr_t)(block + off);
+		dp = (struct direct *)(uintptr_t)(block->buf + off);
 		dp->d_ino = 0;
 		dp->d_reclen = DIRBLKSIZ;
 		dp->d_type = DT_UNKNOWN;