mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH net-next] net: xgene: Fix the size of the IRQ name buffer
@ 2026-11-06  4:44 xujiahao
  2026-11-12  1:50 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: xujiahao @ 2026-11-06  4:44 UTC (permalink / raw)
  To: netdev
  Cc: Iyappan Subramanian, Keyur Chudgar, Quan Nguyen, linux-kernel, xujiahao

xgene_enet_set_irq_name() composes the interrupt names as
"<netdev>-rx-txc", "<netdev>-rx-%d" and "<netdev>-txc-%d" into
ring->irq_name[], which is IRQ_ID_SIZE bytes.  A 15-character netdev
name plus "-txc-" and a full-range %d needs 31 bytes including the
terminator, so the names of long interfaces can be truncated, and gcc
reports it in a W=1 build:

  drivers/net/ethernet/apm/xgene/xgene_enet_main.c:888:66: warning: '-rx-txc' directive output may be truncated writing 7 bytes into a region of size between 1 and 16 [-Wformat-truncation=]
  drivers/net/ethernet/apm/xgene/xgene_enet_main.c:891:66: warning: '-rx-' directive output may be truncated writing 4 bytes into a region of size between 1 and 16 [-Wformat-truncation=]
  drivers/net/ethernet/apm/xgene/xgene_enet_main.c:898:58: warning: '-txc-' directive output may be truncated writing 5 bytes into a region of size between 1 and 16 [-Wformat-truncation=]

Size the name buffer to 32 bytes.  It is only ever read as a string, by
request_irq() and the interrupt logging, so nothing else changes.

Signed-off-by: xujiahao <xujiahao@cmss.chinamobile.com>
---
 drivers/net/ethernet/apm/xgene/xgene_enet_main.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/apm/xgene/xgene_enet_main.h b/drivers/net/ethernet/apm/xgene/xgene_enet_main.h
index bce2c19e3..8eb97f6ed 100644
--- a/drivers/net/ethernet/apm/xgene/xgene_enet_main.h
+++ b/drivers/net/ethernet/apm/xgene/xgene_enet_main.h
@@ -71,7 +71,7 @@
 #define X2_START_BP_BUFNUM_1	0x20
 #define X2_START_RING_NUM_1	256
 
-#define IRQ_ID_SIZE		16
+#define IRQ_ID_SIZE		32
 
 #define PHY_POLL_LINK_ON	(10 * HZ)
 #define PHY_POLL_LINK_OFF	(PHY_POLL_LINK_ON / 5)
-- 
2.43.0




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-11-12  1:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-06  4:44 [PATCH net-next] net: xgene: Fix the size of the IRQ name buffer xujiahao
2026-11-12  1:50 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®