[PATCH 2/2] mailbox: axiado: fix debugfs name truncation warning

Swark Yang syang at axiado.com
Thu Sep 3 00:17:53 PDT 2026


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: 14af7a96afa3 ("mailbox: add Axiado AX3005 mailbox driver")
Reported-by: kernel test robot <lkp at intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202608250447.gGkRwNAl-lkp@intel.com/
Signed-off-by: Swark Yang <syang at axiado.com>
---
 drivers/mailbox/axiado-mailbox.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mailbox/axiado-mailbox.c b/drivers/mailbox/axiado-mailbox.c
index aa1dcc1b267d..a87693c639dc 100644
--- a/drivers/mailbox/axiado-mailbox.c
+++ b/drivers/mailbox/axiado-mailbox.c
@@ -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];

-- 
2.34.1




More information about the linux-arm-kernel mailing list