From: 晏艳(采苓) Date: Sat, 6 May 2023 07:42:53 +0000 (+0800) Subject: sched/debug: Correct printing for rq->nr_uninterruptible X-Git-Tag: v6.6.7~2571^2~35 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a6fcdd8d95f7486150b3faadfea119fc3dfc3b74;p=platform%2Fkernel%2Flinux-starfive.git sched/debug: Correct printing for rq->nr_uninterruptible Commit e6fe3f422be1 ("sched: Make multiple runqueue task counters 32-bit") changed the type for rq->nr_uninterruptible from "unsigned long" to "unsigned int", but left wrong cast print to /sys/kernel/debug/sched/debug and to the console. For example, nr_uninterruptible's value is fffffff7 with type "unsigned int", (long)nr_uninterruptible shows 4294967287 while (int)nr_uninterruptible prints -9. So using int cast fixes wrong printing. Signed-off-by: Yan Yan Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20230506074253.44526-1-yanyan.yan@antgroup.com --- diff --git a/kernel/sched/debug.c b/kernel/sched/debug.c index 0b2340a..066ff1c 100644 --- a/kernel/sched/debug.c +++ b/kernel/sched/debug.c @@ -777,7 +777,7 @@ static void print_cpu(struct seq_file *m, int cpu) #define P(x) \ do { \ if (sizeof(rq->x) == 4) \ - SEQ_printf(m, " .%-30s: %ld\n", #x, (long)(rq->x)); \ + SEQ_printf(m, " .%-30s: %d\n", #x, (int)(rq->x)); \ else \ SEQ_printf(m, " .%-30s: %Ld\n", #x, (long long)(rq->x));\ } while (0)