linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] sched: debug: Promote atomic64_read to u64 for printing
@ 2013-01-27 14:58 Fabio Estevam
  0 siblings, 0 replies; only message in thread
From: Fabio Estevam @ 2013-01-27 14:58 UTC (permalink / raw)
  To: mingo; +Cc: pjt, linux-kernel, Fabio Estevam

From: Fabio Estevam <fabio.estevam@freescale.com>

commit 2d58000fd (sched: Fix print format for u64) introduced the following 
build warning for x86_64:

kernel/sched/debug.c: In function 'print_cfs_rq':
kernel/sched/debug.c:225:2: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 4 has type 'long int' [-Wformat]
kernel/sched/debug.c:225:2: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 3 has type 'long int' [-Wformat]

atomi64_read() function may have a different returning type depending on the 
architecture, so in order to guarantee that it builds fine on any system without
warnings, promote it to u64 for printing purpose.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
 kernel/sched/debug.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/sched/debug.c b/kernel/sched/debug.c
index b46faf5..2aacabe 100644
--- a/kernel/sched/debug.c
+++ b/kernel/sched/debug.c
@@ -216,7 +216,7 @@ void print_cfs_rq(struct seq_file *m, int cpu, struct cfs_rq *cfs_rq)
 	SEQ_printf(m, "  .%-30s: %lld\n", "blocked_load_avg",
 			cfs_rq->blocked_load_avg);
 	SEQ_printf(m, "  .%-30s: %llu\n", "tg_load_avg",
-			atomic64_read(&cfs_rq->tg->load_avg));
+			(u64)atomic64_read(&cfs_rq->tg->load_avg));
 	SEQ_printf(m, "  .%-30s: %lld\n", "tg_load_contrib",
 			cfs_rq->tg_load_contrib);
 	SEQ_printf(m, "  .%-30s: %d\n", "tg_runnable_contrib",
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2013-01-27 14:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-27 14:58 [PATCH] sched: debug: Promote atomic64_read to u64 for printing Fabio Estevam

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).