public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Przemek Kitszel <przemyslaw.kitszel@intel.com>
To: Przemyslaw Korba <przemyslaw.korba@intel.com>
Cc: <netdev@vger.kernel.org>, <anthony.l.nguyen@intel.com>,
	<intel-wired-lan@lists.osuosl.org>
Subject: Re: [Intel-wired-lan] [PATCH iwl-net v2] ice: dpll: Fix compilation warning
Date: Tue, 24 Feb 2026 09:57:06 +0100	[thread overview]
Message-ID: <9e9c69b6-643b-40c4-afe5-fdbcb185755d@intel.com> (raw)
In-Reply-To: <20260223143214.241797-1-przemyslaw.korba@intel.com>

On 2/23/26 15:31, 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")

thank you for the fix
this is a correct tag, and a correct target

> Signed-off-by: Przemyslaw Korba <przemyslaw.korba@intel.com>
> ---
>   drivers/net/ethernet/intel/ice/ice_dpll.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/intel/ice/ice_dpll.c b/drivers/net/ethernet/intel/ice/ice_dpll.c
> index 73a4e28ed75f..f101fdb3e9cf 100644
> --- a/drivers/net/ethernet/intel/ice/ice_dpll.c
> +++ b/drivers/net/ethernet/intel/ice/ice_dpll.c
> @@ -3532,7 +3532,7 @@ static int
>   ice_dpll_init_fwnode_pins(struct ice_pf *pf, struct ice_dpll_pin *pins,
>   			  int start_idx)
>   {
> -	char pin_name[8];
> +	char pin_name[16];
>   	int i, ret;
>   
>   	pf->dplls.wq = create_singlethread_workqueue("ice_dpll_wq");

3537│         for (i = 0; i < pf->dplls.rclk.num_parents; i++) {

upper bound of the loop is u8 (ok), but we assign it as an int (good)

3538│                 pins[start_idx + i].pf = pf;
3539│                 snprintf(pin_name, sizeof(pin_name), "rclk%u", i);

compiler tries to be too smart here


anyway, it's better to have that warning gone instead of waiting for
a fix in the compiler

Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>

  reply	other threads:[~2026-02-24  8:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-23 14:31 [PATCH iwl-net v2] ice: dpll: Fix compilation warning Przemyslaw Korba
2026-02-24  8:57 ` Przemek Kitszel [this message]
2026-03-02 12:01   ` [Intel-wired-lan] " Korba, Przemyslaw
2026-02-25  9:59 ` Simon Horman
2026-03-02 12:01   ` Korba, Przemyslaw
2026-03-02 14:04     ` Simon Horman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9e9c69b6-643b-40c4-afe5-fdbcb185755d@intel.com \
    --to=przemyslaw.kitszel@intel.com \
    --cc=anthony.l.nguyen@intel.com \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=netdev@vger.kernel.org \
    --cc=przemyslaw.korba@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox