Re: [PATCH v3 1/2] axis-fifo: use devm_kasprintf() for allocating formatted strings

From: Greg KH
Date: Sat May 27 2023 - 03:36:46 EST


On Thu, May 18, 2023 at 08:21:53PM +0530, Prathu Baronia 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.

Maybe error-prone, but all is fine with the original code, right?

> Replace this by calling devm_kasprintf() instead, which always uses the
> appropriate size.
>
> Also fix an old smatch warning reported by lkp introduced by commit
> d2d7aa53891e. In the mentioned commit we had used "%pa" format specifier
> for a void* type and hence smatch complained about its use instead of
> "%p".

When you have "also" in a changelog commit, that usually means this
needs to be split out into a separate patch. And that's the case here,
make the first patch of the series fix the problem. Then do your
cleanups on later patches.

> Fixes: d2d7aa53891e ("staging: axis-fifo: convert to use miscdevice")

changing to a different string function does not fix anything.

> Reported-by: kernel test robot <lkp@xxxxxxxxx>

It did not report that you need to replace a string function, right?

See, things got messy when you mixed in changes into one. Please break
these up.

thanks,

greg k-h