Re: [PATCH v2] staging: media: atomisp: refactor pipe graph dump stage formatting
From: Neal Patalay
Date: Sun Jul 05 2026 - 03:19:32 EST
On Sat, Jul 4, 2026 at 11:37 PM Andy Shevchenko
<andriy.shevchenko@xxxxxxxxx> wrote:
> The definition should go to the top of the function, there are only a few
> exceptions and none is for this case.
>
> Also for the sake of better layering, introduce local variables to track values
> of offset and line_len and only assign them at the end.
Thank you, I'll implement this.
> There is no need to have do {} while (0) as there is conditional already and the
> macro doesn't return anything. Also it's wrongly indented.
>
> The below should work.
>
> #define ADD_INFO(flag, flag_str) \
> if (bi->enable.flag) \
> ia_css_debug_build_info(enable_info, sizeof(enable_info), \
> &offset, \
> flag_str, sizeof(flag_str), \
> &line_len); \
>
Great, I'll fix the indentation and remove the loop. However, please be
aware that the loop's purpose was silencing a spurious checkpatch error,
so that will reappear. Also, I'll take the final "\" off the end of
the macro you
provided and also remove the ";" since that raises a checkpatch warning.
--
Thank you,
Neal Patalay