From: Zhao Lei <zhaolei@cn.fujitsu.com>
To: <linux-kernel@vger.kernel.org>, Tejun Heo <htejun@gmail.com>,
Peter Zijlstra <peterz@infradead.org>
Cc: Yang Dongsheng <yangds.fnst@cn.fujitsu.com>,
Zhao Lei <zhaolei@cn.fujitsu.com>
Subject: [PATCH v3 1/3] cpuacct: rename parameter in cpuusage_write for readability
Date: Thu, 17 Mar 2016 12:19:42 +0800 [thread overview]
Message-ID: <778412ba2feaa95bb0f1663bc139e3a8829d729d.1458187654.git.zhaolei@cn.fujitsu.com> (raw)
In-Reply-To: <cover.1458187654.git.zhaolei@cn.fujitsu.com>
From: Yang Dongsheng <yangds.fnst@cn.fujitsu.com>
The name of 'reset' makes a little confusion in reading, we would
say, if we want to reset usage, return -EINVAL. That's not true.
Actually, we want to say, we only allow user to do a reset. This
patch rename reset to val and add a comment here, making the code
more readable.
From: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
---
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;
}
--
1.8.5.1
next prev parent reply other threads:[~2016-03-17 4:21 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-17 4:19 [PATCH v3 0/3] cpuacct: split usage into user_usage and sys_usage Zhao Lei
2016-03-17 4:19 ` Zhao Lei [this message]
2016-03-17 4:19 ` [PATCH v3 2/3] Some small restruct for cpuacct Zhao Lei
2016-03-21 11:17 ` [tip:sched/urgent] sched/cpuacct: Simplify the cpuacct code tip-bot for Zhao Lei
2016-03-17 4:19 ` [PATCH v3 3/3] cpuacct: split usage into user_usage and sys_usage Zhao Lei
2016-03-17 8:40 ` Peter Zijlstra
2016-03-17 9:42 ` Zhao Lei
2016-03-17 10:12 ` Peter Zijlstra
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=778412ba2feaa95bb0f1663bc139e3a8829d729d.1458187654.git.zhaolei@cn.fujitsu.com \
--to=zhaolei@cn.fujitsu.com \
--cc=htejun@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=peterz@infradead.org \
--cc=yangds.fnst@cn.fujitsu.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®