xgene_enet_set_irq_name() composes the interrupt names as "-rx-txc", "-rx-%d" and "-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 --- 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