Re: [PATCH v3] staging: fbtft: replace empty macro args with identity converter
From: Andy Shevchenko
Date: Mon Apr 13 2026 - 02:09:33 EST
On Mon, Apr 13, 2026 at 9:03 AM Greg KH <gregkh@xxxxxxxxxxxxxxxxxxx> wrote:
> On Mon, Apr 13, 2026 at 08:58:50AM +0300, Andy Shevchenko wrote:
> > On Sun, Apr 12, 2026 at 8:33 PM Baker <mzndmzn@xxxxxxxxx> wrote:
> > >
> > > The define_fbtft_write_reg macro calls 'modifier' as a function.
> > > Passing an empty token as modifier is undefined behavior in C for
> > > fixed-arity macros. Introduce fbtft_no_conv() as an identity
> > > function to replace the empty args in the no-conversion cases.
> >
> > This trick is used in the kernel (usually for u8). If you really want
> > to improve, use _Generic() instead.
>
> No, sorry, this code is fine as-is.
Works for me. I suggested they explore the possibilities, it might be
helpful somewhere else in case of the similar requirements (like in a
new code).
--
With Best Regards,
Andy Shevchenko