git: 8a59ea47d92c - stable/14 - sched_ule: 32-bit platforms: Fix runq_print() after runq changes

From: Olivier Certner <olce_at_FreeBSD.org>
Date: Mon, 28 Jul 2025 13:31:42 UTC
The branch stable/14 has been updated by olce:

URL: https://cgit.FreeBSD.org/src/commit/?id=8a59ea47d92c3c4b6dca61a3c21346ae34b30b61

commit 8a59ea47d92c3c4b6dca61a3c21346ae34b30b61
Author:     Olivier Certner <olce@FreeBSD.org>
AuthorDate: 2025-06-18 15:15:18 +0000
Commit:     Olivier Certner <olce@FreeBSD.org>
CommitDate: 2025-07-28 13:28:44 +0000

    sched_ule: 32-bit platforms: Fix runq_print() after runq changes
    
    The compiler would report a mismatch between the format and the actual
    type of the runqueue status word because the latter is now
    unconditionally defined as an 'unsigned long' (which has the "natural"
    platform size) and the format expects a 'size_t', which expands to an
    'unsigned int' on 32-bit platforms (although they are both of the same
    actual size).
    
    This worked before as the C type used depended on the architecture and
    was set to 'uint32_t' aka 'unsigned int' on these 32-bit platforms.
    
    Just fix the format (use 'l').  While here, remove outputting '0x' by
    hand, instead relying on '#' (only difference is for 0, and is fine).
    
    runq_print() should be moved out of 'sched_ule.c' in a subsequent
    commit.
    
    Reported by:    Jenkins
    Fixes:          79d8a99ee583 ("runq: Deduce most parameters, remove machine headers")
    MFC after:      1 month
    Event:          Kitchener-Waterloo Hackathon 202506
    Sponsored by:   The FreeBSD Foundation
    
    (cherry picked from commit 013c58ced6aef26bad7ca5c6eb829b9d586f6edb)
---
 sys/kern/sched_ule.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/kern/sched_ule.c b/sys/kern/sched_ule.c
index b09d6dfc0f54..f59b7195f754 100644
--- a/sys/kern/sched_ule.c
+++ b/sys/kern/sched_ule.c
@@ -444,7 +444,7 @@ runq_print(struct runq *rq)
 	int i;
 
 	for (i = 0; i < RQSW_NB; i++) {
-		printf("\t\trunq bits %d 0x%zx\n",
+		printf("\t\trunq bits %d %#lx\n",
 		    i, rq->rq_status.rq_sw[i]);
 		for (j = 0; j < RQSW_BPW; j++)
 			if (rq->rq_status.rq_sw[i] & (1ul << j)) {