From 9d95d806691e4ef1411c6c3b892d8b774754d724 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dag-Erling=20Sm=C3=B8rgrav?= Date: Sat, 11 Apr 2026 21:23:08 +0200 Subject: [PATCH] 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 56160dafce2..f3e9306f8ca 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;