🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: linux.kernel.netdev
2 messages
2 total messages Started by xujiahao Fri, 06 Nov 2026 04:44
[PATCH net-next] net: xgene: Fix the size of the IRQ name buffer
#11991
Author: xujiahao
Date: Fri, 06 Nov 2026 04:44
35 lines
10156 bytes
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
Re: [PATCH net-next] net: xgene: Fix the size of the IRQ name buffer
#14827
Author: patchwork-bot+netdevbpf
Date: Thu, 12 Nov 2026 01:50
24 lines
8650 bytes
Hello:

This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Fri,  6 Nov 2026 12:44:21 +0800 you wrote:
> 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:
> 
> [...]

Here is the summary with links:
  - [net-next] net: xgene: Fix the size of the IRQ name buffer
    https://git.kernel.org/netdev/net-next/c/9dc4c50bedfc

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads