Re: [PATCH 2/2] media: atomisp: Fix Wformat-truncation warning

From: Andy Shevchenko
Date: Tue Apr 01 2025 - 09:04:48 EST


On Mon, Mar 31, 2025 at 7:38 PM Ricardo Ribalda <ribalda@xxxxxxxxxxxx> wrote:
>
> Gcc8 is convinced that we do not have enough space in dot_id_input_bin.
> Extend the variable 17 bytes. It is just used for debugging.
>
> drivers/staging/media/atomisp/pci/runtime/debug/src/ia_css_debug.c:1336:9: warning: '(pipe' directive output may be truncated writing 5 bytes into a region of size between 1 and 74 [-Wformat-truncation=]

...

> -static char dot_id_input_bin[SH_CSS_MAX_BINARY_NAME + 10];
> +static char dot_id_input_bin[SH_CSS_MAX_BINARY_NAME + 27];

I'm okay with the approach, but can you also add a comment to explain
27, please?
(I mean something like "27 is the combined length of 'pipe' plus ...")

--
With Best Regards,
Andy Shevchenko