Re: [PATCH] clk: microchip: mpfs-ccc: Use devm_kasprintf() for allocating formatted strings

From: Geert Uytterhoeven
Date: Wed Jan 04 2023 - 08:32:26 EST


Hi Conor,

On Tue, Jan 3, 2023 at 6:32 PM Conor Dooley <conor@xxxxxxxxxx> wrote:
> On Tue, Jan 03, 2023 at 05:45:30PM +0100, Geert Uytterhoeven wrote:
> > In various places, string buffers of a fixed size are allocated, and
> > filled using snprintf() with the same fixed size, which is error-prone.
> >
> > Replace this by calling devm_kasprintf() instead, which always uses the
> > appropriate size.
> >
> > While at it, remove an unneeded intermediate variable, which allows us
> > to drop a cast as a bonus.
> >
> > Signed-off-by: Geert Uytterhoeven <geert+renesas@xxxxxxxxx>
>
> Reviewed-by: Conor Dooley <conor.dooley@xxxxxxxxxxxxx>
> Tested-by: Conor Dooley <conor.dooley@xxxxxxxxxxxxx>

Thanks!

> I half wonder if this should actually have a fixes tag too. Since it
> used what came after the @ in $full_name, it'd be possible to create
> (an incorrect) DTS that would lead to a clash between pll names &
> therefore probe would fail.
> The tag would be:
> Fixes: d39fb172760e ("clk: microchip: add PolarFire SoC fabric clock support")

But I don't change any of that in my patch?
/me confused.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

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