Skip to content

Commit

Permalink
sched/cpuacct: Rename parameter in cpuusage_write() for readability
Browse files Browse the repository at this point in the history
The name of the 'reset' parameter to cpuusage_write() is quite confusing,
because the only valid value we allow is '0', so !reset is actually the
case that resets ...

Rename it to 'val' and explain it in a comment that we only allow 0.

Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: cgroups@vger.kernel.org
Cc: tj@kernel.org
Link: http://lkml.kernel.org/r/1450696483-2864-1-git-send-email-yangds.fnst@cn.fujitsu.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
  • Loading branch information
Dongsheng Yang authored and Ingo Molnar committed Mar 21, 2016
1 parent d433558 commit 1a736b7
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions kernel/sched/cpuacct.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,13 +145,16 @@ static u64 cpuusage_read(struct cgroup_subsys_state *css, struct cftype *cft)
}

static int cpuusage_write(struct cgroup_subsys_state *css, struct cftype *cft,
u64 reset)
u64 val)
{
struct cpuacct *ca = css_ca(css);
int err = 0;
int i;

if (reset) {
/*
* Only allow '0' here to do a reset.
*/
if (val) {
err = -EINVAL;
goto out;
}
Expand Down

0 comments on commit 1a736b7

Please sign in to comment.