mailbox: axiado: fix debugfs name truncation warning

kernel test robot reported a format-truncation warning for the
snprintf() that builds each channel's debugfs entry name:

  drivers/mailbox/axiado-mailbox.c:325:39: warning: '-errors'
  directive output may be truncated writing 7 bytes into a region
  of size between 2 and 11 [-Wformat-truncation=]

AX3005 exposes 16 mailbox channels, so the longest name generated at
runtime is "chan15-errors" and already fits in the original buffer.
However, the compiler cannot infer that bound from
drv_data->num_chans and therefore assumes the unsigned channel index
may require up to 10 decimal digits. Widen the buffer to 32 bytes,
which removes the -Wformat-truncation warning with no functional
change.

Fixes: 14af7a96af ("mailbox: add Axiado AX3005 mailbox driver")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202608250447.gGkRwNAl-lkp@intel.com/
Signed-off-by: Swark Yang <syang@axiado.com>
Signed-off-by: Jassi Brar <jassisinghbrar@gmail.com>
This commit is contained in:
Swark Yang 2026-09-03 00:17:53 -07:00 committed by Jassi Brar
parent fe43cf02f4
commit 5cefa9bc51

View File

@ -379,7 +379,7 @@ static int axiado_mbox_probe(struct platform_device *pdev)
return ret;
for (i = 0; i < drv_data->num_chans; i++) {
char name[16];
char name[32];
ch_data[i].channel_num = i;
ch_data[i].chan = &mb->mbox.chans[i];