Re: [PATCH v1 10/15] auxdisplay: linedisp: Provide a small buffer in the struct linedisp

Andy Shevchenko
2024-02-12T11:50:19Z

On Mon, Feb 12, 2024 at 09:25:00AM +0100, Robin van der Gracht wrote:
> On Thu, 8 Feb 2024 20:48:08 +0200
> Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote:

> > + linedisp->num_chars = buf ? num_chars : min(num_chars, LINEDISP_DEFAULT_BUF_SZ);
>
> It's not a big buffer, but now it's always there even if it's not used.
> And even if it's used, it might be only partially used.
> Why not used a malloc instead?

malloc() infra takes more than this IIRC (something like up to 32 bytes on
64-bit platforms) or comparable sizes. Yes, the malloc() along with the
linedisp structure might make sense, but will require more invasive change.

Do you want me to drop this one from the set?
(I have no hard feelings about it, as I see better way and just having no
time for taking care about, as it's not the main point of the series.)

--
With Best Regards,
Andy Shevchenko