Re: [PATCH] staging: fbtft: Fix line length warning

From: Himanshu Bakshi

Date: Mon Oct 26 2026 - 00:52:22 EST


Hi Andy,

I have sent over the revised patch (v2) over the mail, and will be glad if
you go through it.

I have made sure that the \ (backslash) is properly aligned to the same
column as the rest of the macro. I have also taken into account your
advice and hence added a local variable for platform data.

After some thorough searching through the respective directory, I have
not found any calls for fbtft_init_dbg. This might be because it's a
helper macro that might be useful as the driver progresses.

I have also noticed that some other macros around this one have simple
style issues and if you would like, I can send another different patch
cleaning up those too.

I have also done minimal testing by using the macro once to make sure it
compiles and has no errors, if you would like, I can also run any
standalone tests for this macro.

Thanks and Regards,
Himanshu Bakshi

On Sun, Oct 25, 2026 at 8:31 PM Andy Shevchenko
<andriy.shevchenko@xxxxxxxxx> wrote:
>
> On Sat, Oct 24, 2026 at 11:38:03PM +0530, himanshu bakshi wrote:
> >
> > Split the line in fbtft_init_dbg macro to keep it within the limit of 100
> > columns and address the check-patch warning.
>
> checkpatch
> (in one word)
>
> ...
>
> > #define fbtft_init_dbg(dev, format, arg...) \
> > do { \
> > if (unlikely((dev)->platform_data && \
> > - (((struct fbtft_platform_data *)(dev)->platform_data)->display.debug & DEBUG_DRIVER_INIT_FUNCTIONS))) \
> > + (((struct fbtft_platform_data *)(dev)->platform_data)-> \
> > + display.debug & DEBUG_DRIVER_INIT_FUNCTIONS))) \
> > dev_info(dev, format, ##arg); \
> > } while (0)
>
> First of all, make sure that \ (backslashes) occupy the same column on each
> line of this macro. Next one, it's better to add a temporary variable to
> hold the platform data pointer. Something like
>
> struct fbtft_platform_data *__pd = dev_get_platdata(dev); \
> \
> if (unlikely(pd && pd->display.debug & DEBUG_DRIVER_INIT_FUNCTIONS) \
> dev_info(dev, format, ##arg); \
>
> And last, but not least, have you checked with `git grep` how it's being used?
>
> --
> With Best Regards,
> Andy Shevchenko
>
>