git: 3f850550d606 - main - pctrie: Fix size of printed value in KASSERT
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sun, 16 Feb 2025 21:27:34 UTC
The branch main has been updated by dougm:
URL: https://cgit.FreeBSD.org/src/commit/?id=3f850550d6067bd0f549602d3b372939bd214e31
commit 3f850550d6067bd0f549602d3b372939bd214e31
Author: Doug Moore <dougm@FreeBSD.org>
AuthorDate: 2025-02-16 21:24:13 +0000
Commit: Doug Moore <dougm@FreeBSD.org>
CommitDate: 2025-02-16 21:27:21 +0000
pctrie: Fix size of printed value in KASSERT
The value 'index' in a pctrie iterator cannot be written
with "%lx" on a 32-bit machine. Use '%jx' after a uintmax_t cast instead.
Reported by: bz
Fixes: bba883df5e88d0fb1133b23c05db5501dd321ad8
---
sys/kern/subr_pctrie.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/sys/kern/subr_pctrie.c b/sys/kern/subr_pctrie.c
index 51be005cccd7..a17c386a6e24 100644
--- a/sys/kern/subr_pctrie.c
+++ b/sys/kern/subr_pctrie.c
@@ -900,7 +900,8 @@ pctrie_iter_remove(struct pctrie_iter *it, struct pctrie_node **freenode)
{
KASSERT(NULL != pctrie_match_value(pctrie_node_load(pctrie_child(
it->ptree, it->node, it->index), NULL, PCTRIE_LOCKED), it->index),
- ("%s: removing value %lx not at iter", __func__, it->index));
+ ("%s: removing value %jx not at iter", __func__,
+ (uintmax_t)it->index));
pctrie_remove(it->ptree, it->node, it->index, freenode);
if (*freenode != NULL)
it->node = pctrie_parent(it->node);