Commit-ID:  1a736b77a3f50910843d076623204ba6e5057dc1
Gitweb:     http://git.kernel.org/tip/1a736b77a3f50910843d076623204ba6e5057dc1
Author:     Dongsheng Yang <yangds.f...@cn.fujitsu.com>
AuthorDate: Mon, 21 Dec 2015 19:14:42 +0800
Committer:  Ingo Molnar <mi...@kernel.org>
CommitDate: Mon, 21 Mar 2016 10:59:29 +0100

sched/cpuacct: Rename parameter in cpuusage_write() for readability

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.f...@cn.fujitsu.com>
Cc: Linus Torvalds <torva...@linux-foundation.org>
Cc: Peter Zijlstra <pet...@infradead.org>
Cc: Thomas Gleixner <t...@linutronix.de>
Cc: cgro...@vger.kernel.org
Cc: t...@kernel.org
Link: 
http://lkml.kernel.org/r/1450696483-2864-1-git-send-email-yangds.f...@cn.fujitsu.com
Signed-off-by: Ingo Molnar <mi...@kernel.org>
---
 kernel/sched/cpuacct.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/kernel/sched/cpuacct.c b/kernel/sched/cpuacct.c
index dd7cbb5..9c2bbf7 100644
--- a/kernel/sched/cpuacct.c
+++ b/kernel/sched/cpuacct.c
@@ -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;
        }

Reply via email to