lkml.org 
[lkml]   [2014]   [Jun]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2014-06-28 02:01    [W:0.060 / U:0.152 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site