git: 2ab1b6b2d3ac - stable/15 - mtx: Sprinkle const qualifiers where appropriate

From: Zhenlei Huang <zlei_at_FreeBSD.org>
Date: Fri, 19 Sep 2025 02:01:57 UTC
The branch stable/15 has been updated by zlei:

URL: https://cgit.FreeBSD.org/src/commit/?id=2ab1b6b2d3acbddc7dbc9a9292774e6f8ddcabd6

commit 2ab1b6b2d3acbddc7dbc9a9292774e6f8ddcabd6
Author:     Zhenlei Huang <zlei@FreeBSD.org>
AuthorDate: 2025-09-05 16:00:04 +0000
Commit:     Zhenlei Huang <zlei@FreeBSD.org>
CommitDate: 2025-09-19 02:00:50 +0000

    mtx: Sprinkle const qualifiers where appropriate
    
    No functional change intended.
    
    MFC after:      2 weeks
    
    (cherry picked from commit 7bbfcc540810ba08f75b8f04263bb9a25f1cf45e)
---
 sys/kern/kern_mutex.c | 4 ++--
 sys/sys/mutex.h       | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/sys/kern/kern_mutex.c b/sys/kern/kern_mutex.c
index f952b3fc8805..8b5908f5219a 100644
--- a/sys/kern/kern_mutex.c
+++ b/sys/kern/kern_mutex.c
@@ -1136,9 +1136,9 @@ __mtx_assert(const volatile uintptr_t *c, int what, const char *file, int line)
  * General init routine used by the MTX_SYSINIT() macro.
  */
 void
-mtx_sysinit(void *arg)
+mtx_sysinit(const void *arg)
 {
-	struct mtx_args *margs = arg;
+	const struct mtx_args *margs = arg;
 
 	mtx_init((struct mtx *)margs->ma_mtx, margs->ma_desc, NULL,
 	    margs->ma_opts);
diff --git a/sys/sys/mutex.h b/sys/sys/mutex.h
index 56c03a1b0be9..08d4e2d28b33 100644
--- a/sys/sys/mutex.h
+++ b/sys/sys/mutex.h
@@ -91,7 +91,7 @@
 void	_mtx_init(volatile uintptr_t *c, const char *name, const char *type,
 	    int opts);
 void	_mtx_destroy(volatile uintptr_t *c);
-void	mtx_sysinit(void *arg);
+void	mtx_sysinit(const void *arg);
 int	_mtx_trylock_flags_int(struct mtx *m, int opts LOCK_FILE_LINE_ARG_DEF);
 int	_mtx_trylock_flags_(volatile uintptr_t *c, int opts, const char *file,
 	    int line);