Thread (6 messages) flat view 6 messages, 3 authors, 2026-03-02

Re: [PATCH iwl-net v2] ice: dpll: Fix compilation warning

From: Simon Horman <horms@kernel.org>
Date: 2026-02-25 09:59:45
Also in: intel-wired-lan

On Mon, Feb 23, 2026 at 03:31:55PM +0100, Przemyslaw Korba wrote:
ice_dpll.c: In function ‘ice_dpll_init’:
ice_dpll.c:3588:59: error: ‘%u’ directive output may be truncated
writing between 1 and 10 bytes into a region of size 4
[-Werror=format-truncation=] snprintf(pin_name, sizeof(pin_name),
"rclk%u", i);

Fixes: ad1df4f2d591 ("ice: dpll: Support E825-C SyncE and dynamic pin discovery")
Signed-off-by: Przemyslaw Korba <redacted>
Hi Przemyslaw,

I agree that it is good to address this problem.
But is it a bug?

It seems to me that of the 8 bytes of pin_name, three are available for %u.
So values up to 999 can be safely formatted.  And I suspect that
pf->dplls.rclk.num_parents is always significantly smaller than that.

If so, I'd suggest this is iwl-next material. And should not have
a Fixes tag. But you could cite the commit that introduced the problem
something like this (the part starting with 'commit' is the syntax for
citing commits):

Introduced by commit ad1df4f2d591 ("ice: dpll: Support E825-C SyncE and
dynamic pin discovery")

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