[PATCH v3 01/20] clk: shmobile: r8a7779: Add clocks support

Geert Uytterhoeven geert at linux-m68k.org
Sun Mar 2 06:51:51 EST 2014


On Sun, Mar 2, 2014 at 12:35 PM, Laurent Pinchart
<laurent.pinchart at ideasonboard.com> wrote:
> On Saturday 01 March 2014 14:50:03 Wolfram Sang wrote:
>> > +   cpg = kzalloc(sizeof(*cpg), GFP_KERNEL);
>> > +   clks = kzalloc(CPG_NUM_CLOCKS * sizeof(*clks), GFP_KERNEL);
>> > +   if (cpg == NULL || clks == NULL) {
>> > +           /* We're leaking memory on purpose, there's no point in cleaning
>> > +            * up as the system won't boot anyway.
>> > +            */
>> > +           pr_err("%s: failed to allocate cpg\n", __func__);
>> > +           return;
>> > +   }
>>
>> I have problems with this sloppiness. Writing the comment took probably
>> the same time as writing the proper exit path :) On the drawback side,
>> static code checkers will keep reporting this.
>
> Then static code checkers should be fixed :-) or at least provide an override.
> Given that the system won't boot if this fails I don't see a point in adding
> useless code to the kernel that would just result in a larger binary size.

If binary size is what matters, I think you can remove the pr_err(), too,
as the kzalloc() above will scream, won't it?

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds



More information about the linux-arm-kernel mailing list