* [PATCH] cgroup: Use lld instead of ld when printing pids controller events_limit
@ 2016-06-21 18:55 Kenny Yu
2016-06-21 19:09 ` Tejun Heo
0 siblings, 1 reply; 2+ messages in thread
From: Kenny Yu @ 2016-06-21 18:55 UTC (permalink / raw)
To: tj, lizefan, hannes, cyphar; +Cc: kennyyu, cgroups, linux-kernel, kernel-team
The `events_limit` variable needs to be formatted with %lld and not %ld.
This fixes the following warning discovered by kbuild test robot:
kernel/cgroup_pids.c: In function 'pids_events_show':
kernel/cgroup_pids.c:313:24: warning: format '%ld' expects argument of type
'long int', but argument 3 has type 'long long int' [-Wformat=]
seq_printf(sf, "max %ld\n", atomic64_read(&pids->events_limit));
^
Signed-off-by: Kenny Yu <kennyyu@fb.com>
---
kernel/cgroup_pids.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/cgroup_pids.c b/kernel/cgroup_pids.c
index bd2490b..1777d03 100644
--- a/kernel/cgroup_pids.c
+++ b/kernel/cgroup_pids.c
@@ -310,7 +310,7 @@ static int pids_events_show(struct seq_file *sf, void *v)
{
struct pids_cgroup *pids = css_pids(seq_css(sf));
- seq_printf(sf, "max %ld\n", atomic64_read(&pids->events_limit));
+ seq_printf(sf, "max %lld\n", atomic64_read(&pids->events_limit));
return 0;
}
--
2.8.0.rc2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] cgroup: Use lld instead of ld when printing pids controller events_limit
2016-06-21 18:55 [PATCH] cgroup: Use lld instead of ld when printing pids controller events_limit Kenny Yu
@ 2016-06-21 19:09 ` Tejun Heo
0 siblings, 0 replies; 2+ messages in thread
From: Tejun Heo @ 2016-06-21 19:09 UTC (permalink / raw)
To: Kenny Yu; +Cc: lizefan, hannes, cyphar, cgroups, linux-kernel, kernel-team
Hello,
Added (s64) cast because atomic64 switches between l and ll. No idea
why it doesn't just use s64.
Thanks.
------ 8< ------
>From 9f6870dd9790dd87da1d0cf9e43e60113f3a278d Mon Sep 17 00:00:00 2001
From: Kenny Yu <kennyyu@fb.com>
Date: Tue, 21 Jun 2016 11:55:35 -0700
Subject: [PATCH] cgroup: Use lld instead of ld when printing pids controller
events_limit
The `events_limit` variable needs to be formatted with %lld and not %ld.
This fixes the following warning discovered by kbuild test robot:
kernel/cgroup_pids.c: In function 'pids_events_show':
kernel/cgroup_pids.c:313:24: warning: format '%ld' expects argument of type
'long int', but argument 3 has type 'long long int' [-Wformat=]
seq_printf(sf, "max %ld\n", atomic64_read(&pids->events_limit));
^
tj: Added explicit (s64) cast as atomic64 switches between long long
and long depending on 32 or 64.
Signed-off-by: Kenny Yu <kennyyu@fb.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
---
kernel/cgroup_pids.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/cgroup_pids.c b/kernel/cgroup_pids.c
index 9740ea6..2bd6737 100644
--- a/kernel/cgroup_pids.c
+++ b/kernel/cgroup_pids.c
@@ -310,7 +310,7 @@ static int pids_events_show(struct seq_file *sf, void *v)
{
struct pids_cgroup *pids = css_pids(seq_css(sf));
- seq_printf(sf, "max %ld\n", atomic64_read(&pids->events_limit));
+ seq_printf(sf, "max %lld\n", (s64)atomic64_read(&pids->events_limit));
return 0;
}
--
2.7.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-06-21 20:01 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-21 18:55 [PATCH] cgroup: Use lld instead of ld when printing pids controller events_limit Kenny Yu
2016-06-21 19:09 ` Tejun Heo
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).