From mboxrd@z Thu Jan 1 00:00:00 1970 From: Patrick Bellasi Subject: Re: [PATCH v12 1/6] sched/core: uclamp: Extend CPU's cgroup controller Date: Thu, 1 Aug 2019 11:40:14 +0100 Message-ID: <20190801104014.amwvjdvabedsd5t7@e110439-lin> References: <20190718181748.28446-1-patrick.bellasi@arm.com> <20190718181748.28446-2-patrick.bellasi@arm.com> <20190725114104.GA32159@blackbody.suse.cz> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Return-path: Content-Disposition: inline In-Reply-To: <20190725114104.GA32159@blackbody.suse.cz> Sender: linux-kernel-owner@vger.kernel.org To: Michal =?utf-8?Q?Koutn=C3=BD?= Cc: cgroups@vger.kernel.org, linux-api@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, Alessio Balsini , Dietmar Eggemann , Morten Rasmussen , Quentin Perret , Joel Fernandes , Paul Turner , Steve Muckle , Suren Baghdasaryan , Todd Kjos , Peter Zijlstra , "Rafael J . Wysocki" , Tejun Heo , Vincent Guittot , Viresh Kumar , Juri Lelli , Ingo Molnar List-Id: linux-api@vger.kernel.org On 25-Jul 13:41, Michal Koutný wrote: > On Thu, Jul 18, 2019 at 07:17:43PM +0100, Patrick Bellasi wrote: > > +static ssize_t cpu_uclamp_min_write(struct kernfs_open_file *of, > > + char *buf, size_t nbytes, > > + loff_t off) > > +{ > > [...] > > +static ssize_t cpu_uclamp_max_write(struct kernfs_open_file *of, > > + char *buf, size_t nbytes, > > + loff_t off) > > +{ > > [...] > These two functions are almost identical yet not trivial. I think it > wouldn be better to have the code at one place only and distinguish by > the passed clamp_id. Good point, since the removal of the boundary checks on values we now have two identical methods. I'll factor our the common code in a single function. Cheers, Patrick -- #include Patrick Bellasi