Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1362422

[PATCH v4 1/4] cpuacct: rename parameter in cpuusage_write for readability

From Zhao Lei <zhaolei@cn.fujitsu.com>
Newsgroups linux.kernel
Subject [PATCH v4 1/4] cpuacct: rename parameter in cpuusage_write for readability
Date 2016-03-22 09:40 +0100
Message-ID <rfq13-1Ol-5@gated-at.bofh.it> (permalink)
References <rfq13-1Ol-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

[PATCH v4 1/4] cpuacct: rename parameter in cpuusage_write for readability Zhao Lei <zhaolei@cn.fujitsu.com> - 2016-03-22 09:40 +0100

csiph-web