[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140627231026.GA26184@ulmo>
Date: Sat, 28 Jun 2014 01:10:27 +0200
From: Thierry Reding <thierry.reding@...il.com>
To: Stephen Warren <swarren@...dotorg.org>
Cc: Tomeu Vizoso <tomeu.vizoso@...labora.com>,
Mike Turquette <mturquette@...aro.org>,
Rabin Vincent <rabin.vincent@...ricsson.com>,
linux-tegra@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org
Subject: Re: [RFC 5/5] clk: Add floor and ceiling constraints to clock rates
On Fri, Jun 27, 2014 at 04:57:42PM -0600, Stephen Warren wrote:
> On 06/27/2014 01:57 AM, Tomeu Vizoso wrote:
> > Adds a way for clock consumers to set maximum and minimum rates. This can be
> > used for thermal drivers to set ceiling rates, or by misc. drivers to set
> > floor rates to assure a minimum performance level.
>
> > diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
>
> > +static struct rate_constraint *__ensure_constraint(struct clk *clk_user,
> > + enum constraint_type type)
>
> > + if (!found) {
> > + constraint = kzalloc(sizeof(*constraint), GFP_KERNEL);
> > + if (!constraint) {
> > + pr_err("%s: could not allocate constraint\n", __func__);
>
> Doesn't kzalloc print an error itself if the allocation fails? I've
> certainly seen quite a few patches ripping out custom "allocation
> failed" errors in code.
Yes, these are unnecessary. There's even a checkpatch warning for this
construct nowadays:
f9a5a624f414 checkpatch: attempt to find unnecessary 'out of memory' messages
Thierry
Content of type "application/pgp-signature" skipped
Powered by blists - more mailing lists