[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1450146314-4818-1-git-send-email-yangds.fnst@cn.fujitsu.com>
Date: Tue, 15 Dec 2015 10:25:13 +0800
From: Dongsheng Yang <yangds.fnst@...fujitsu.com>
To: <mingo@...hat.com>, <peterz@...radead.org>
CC: <linux-kernel@...r.kernel.org>,
Dongsheng Yang <yangds.fnst@...fujitsu.com>
Subject: [PATCH 1/2] cpuacct: rename parameter in cpuusage_write for readability
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.
Signed-off-by: Dongsheng Yang <yangds.fnst@...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.4.2
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists