Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755146AbcCULSf (ORCPT ); Mon, 21 Mar 2016 07:18:35 -0400 Received: from terminus.zytor.com ([198.137.202.10]:49652 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754037AbcCULSR (ORCPT ); Mon, 21 Mar 2016 07:18:17 -0400 Date: Mon, 21 Mar 2016 04:17:20 -0700 From: tip-bot for Dongsheng Yang Message-ID: Cc: torvalds@linux-foundation.org, yangds.fnst@cn.fujitsu.com, hpa@zytor.com, linux-kernel@vger.kernel.org, peterz@infradead.org, tglx@linutronix.de, mingo@kernel.org Reply-To: linux-kernel@vger.kernel.org, hpa@zytor.com, yangds.fnst@cn.fujitsu.com, torvalds@linux-foundation.org, mingo@kernel.org, tglx@linutronix.de, peterz@infradead.org In-Reply-To: <1450696483-2864-1-git-send-email-yangds.fnst@cn.fujitsu.com> References: <1450696483-2864-1-git-send-email-yangds.fnst@cn.fujitsu.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:sched/urgent] sched/cpuacct: Rename parameter in cpuusage_write() for readability Git-Commit-ID: 1a736b77a3f50910843d076623204ba6e5057dc1 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1638 Lines: 50 Commit-ID: 1a736b77a3f50910843d076623204ba6e5057dc1 Gitweb: http://git.kernel.org/tip/1a736b77a3f50910843d076623204ba6e5057dc1 Author: Dongsheng Yang AuthorDate: Mon, 21 Dec 2015 19:14:42 +0800 Committer: Ingo Molnar 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 Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: cgroups@vger.kernel.org Cc: tj@kernel.org Link: http://lkml.kernel.org/r/1450696483-2864-1-git-send-email-yangds.fnst@cn.fujitsu.com Signed-off-by: Ingo Molnar --- 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; }