aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhenlei Huang <zlei@FreeBSD.org>2025-09-05 16:00:04 +0000
committerZhenlei Huang <zlei@FreeBSD.org>2025-09-05 16:00:04 +0000
commit7bbfcc540810ba08f75b8f04263bb9a25f1cf45e (patch)
tree101ad6baa6690e1d1ce43c0bf49524397ae37d48
parent2a0ed0bef264da39b670461809bf027362dfeb80 (diff)
mtx: Sprinkle const qualifiers where appropriate
No functional change intended. MFC after: 2 weeks
-rw-r--r--sys/kern/kern_mutex.c4
-rw-r--r--sys/sys/mutex.h2
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);