Thread (4 messages) 4 messages, 2 authors, 2025-07-08

Re: [External] : Re: [PATCH net] net: thunderx: Fix format-truncation warning in bgx_acpi_match_id()

From: ALOK TIWARI <hidden>
Date: 2025-07-08 03:05:05
Also in: lkml, netdev


On 7/8/2025 12:46 AM, Simon Horman wrote:
quoted
   drivers/net/ethernet/cavium/thunder/thunder_bgx.c:1434:23: note:
directive argument in the range [0, 255]
     snprintf(bgx_sel, 5, "BGX%d", bgx->bgx_id);
                          ^~~~~~~
   drivers/net/ethernet/cavium/thunder/thunder_bgx.c:1434:2: note:
‘snprintf’ output between 5 and 7 bytes into a destination of size 5
     snprintf(bgx_sel, 5, "BGX%d", bgx->bgx_id);

compiler warning due to insufficient snprintf buffer size.

Signed-off-by: Alok Tiwari<redacted>
Thanks Alok,

I agree this is a good change.

However, by my reading the range of values of bgx->bgx_id is 0 - 8
because of the application of BGX_ID_MASK which restricts the
value to 3 bits.

If so, I don't think this is a bug and it should be targeted at net-next.
With a description of why it is not a bug.

Conversely, you think it is a bug, then I think an explanation as to why
would be nice to add to the commit description.  And A fixes tag is needed.
Thanks Simon,
It is compile warning, We can target it for net-next.

I will resend it with [PATCH net-next]

Thanks,
Alok
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help