All of lore.kernel.org
 help / color / mirror / Atom feed
* [RESEND PATCH 1/2] cpuacct: rename parameter in cpuusage_write for readability
@ 2015-12-21 11:14 ` Dongsheng Yang
  0 siblings, 0 replies; 12+ messages in thread
From: Dongsheng Yang @ 2015-12-21 11:14 UTC (permalink / raw)
  To: cgroups, linux-kernel, mingo, peterz, tj; +Cc: Dongsheng Yang

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@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.4.2



^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2016-03-21 11:18 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-21 11:14 [RESEND PATCH 1/2] cpuacct: rename parameter in cpuusage_write for readability Dongsheng Yang
2015-12-21 11:14 ` Dongsheng Yang
2015-12-21 11:14 ` [RESEND PATCH 2/2] cpuacct: split usage into user_usage and sys_usage Dongsheng Yang
2015-12-21 11:14   ` Dongsheng Yang
     [not found]   ` <1450696483-2864-2-git-send-email-yangds.fnst-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
2015-12-21 21:33     ` Tejun Heo
2015-12-21 21:33       ` Tejun Heo
     [not found]       ` <20151221213328.GP4026-qYNAdHglDFBN0TnZuCh8vA@public.gmane.org>
2015-12-22  8:12         ` Dongsheng Yang
2015-12-22  8:12           ` Dongsheng Yang
2016-03-01 10:35       ` Zhao Lei
2016-03-01 10:35         ` Zhao Lei
2016-03-02 16:12         ` 'Tejun Heo'
2016-03-21 11:17 ` [tip:sched/urgent] sched/cpuacct: Rename parameter in cpuusage_write() for readability tip-bot for Dongsheng Yang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.