Skip to content

Commit

Permalink
cgroup: Use lld instead of ld when printing pids controller events_limit
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Tejun Heo <[email protected]>
  • Loading branch information
kennyyu authored and htejun committed Jun 21, 2016
1 parent 135b8b3 commit 9f6870d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/cgroup_pids.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 9f6870d

Please sign in to comment.