All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vadim Fedorenko <vadim.fedorenko@linux.dev>
To: Brahmajit Das <listout@listout.xyz>,
	netdev@vger.kernel.org, intel-wired-lan@lists.osuosl.org
Cc: anthony.l.nguyen@intel.com, przemyslaw.kitszel@intel.com,
	andrew+netdev@lunn.ch, davem@davemloft.net, kuba@kernel.org
Subject: Re: [Intel-wired-lan] [PATCH] net: intel: fm10k: Fix parameter idx set but not used
Date: Mon, 1 Sep 2025 23:13:05 +0100	[thread overview]
Message-ID: <e13abc99-fb35-4bc4-b110-9ddfa8cdb442@linux.dev> (raw)
In-Reply-To: <20250901213100.3799820-1-listout@listout.xyz>

On 01/09/2025 22:31, Brahmajit Das wrote:
> Variable idx is set in the loop, but is never used resulting in dead
> code. Building with GCC 16, which enables
> -Werror=unused-but-set-parameter= by default results in build error.
> This patch removes the dead code and fixes the build error.
> 
> Signed-off-by: Brahmajit Das <listout@listout.xyz>
> ---
>   drivers/net/ethernet/intel/fm10k/fm10k_common.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/intel/fm10k/fm10k_common.c b/drivers/net/ethernet/intel/fm10k/fm10k_common.c
> index f51a63fca513..2fcbbd5accc2 100644
> --- a/drivers/net/ethernet/intel/fm10k/fm10k_common.c
> +++ b/drivers/net/ethernet/intel/fm10k/fm10k_common.c
> @@ -457,7 +457,7 @@ void fm10k_unbind_hw_stats_q(struct fm10k_hw_stats_q *q, u32 idx, u32 count)
>   {
>   	u32 i;
>   
> -	for (i = 0; i < count; i++, idx++, q++) {
> +	for (i = 0; i < count; i++, q++) {
>   		q->rx_stats_idx = 0;
>   		q->tx_stats_idx = 0;
>   	}

All callers to this function provide constant 0 as idx param. The better
solution would be to remove the parameter completely.

WARNING: multiple messages have this Message-ID (diff)
From: Vadim Fedorenko <vadim.fedorenko@linux.dev>
To: Brahmajit Das <listout@listout.xyz>,
	netdev@vger.kernel.org, intel-wired-lan@lists.osuosl.org
Cc: anthony.l.nguyen@intel.com, przemyslaw.kitszel@intel.com,
	andrew+netdev@lunn.ch, davem@davemloft.net, kuba@kernel.org
Subject: Re: [PATCH] net: intel: fm10k: Fix parameter idx set but not used
Date: Mon, 1 Sep 2025 23:13:05 +0100	[thread overview]
Message-ID: <e13abc99-fb35-4bc4-b110-9ddfa8cdb442@linux.dev> (raw)
In-Reply-To: <20250901213100.3799820-1-listout@listout.xyz>

On 01/09/2025 22:31, Brahmajit Das wrote:
> Variable idx is set in the loop, but is never used resulting in dead
> code. Building with GCC 16, which enables
> -Werror=unused-but-set-parameter= by default results in build error.
> This patch removes the dead code and fixes the build error.
> 
> Signed-off-by: Brahmajit Das <listout@listout.xyz>
> ---
>   drivers/net/ethernet/intel/fm10k/fm10k_common.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/intel/fm10k/fm10k_common.c b/drivers/net/ethernet/intel/fm10k/fm10k_common.c
> index f51a63fca513..2fcbbd5accc2 100644
> --- a/drivers/net/ethernet/intel/fm10k/fm10k_common.c
> +++ b/drivers/net/ethernet/intel/fm10k/fm10k_common.c
> @@ -457,7 +457,7 @@ void fm10k_unbind_hw_stats_q(struct fm10k_hw_stats_q *q, u32 idx, u32 count)
>   {
>   	u32 i;
>   
> -	for (i = 0; i < count; i++, idx++, q++) {
> +	for (i = 0; i < count; i++, q++) {
>   		q->rx_stats_idx = 0;
>   		q->tx_stats_idx = 0;
>   	}

All callers to this function provide constant 0 as idx param. The better
solution would be to remove the parameter completely.

  reply	other threads:[~2025-09-01 22:13 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-01 21:31 [Intel-wired-lan] [PATCH] net: intel: fm10k: Fix parameter idx set but not used Brahmajit Das
2025-09-01 21:31 ` Brahmajit Das
2025-09-01 22:13 ` Vadim Fedorenko [this message]
2025-09-01 22:13   ` Vadim Fedorenko
2025-09-02  7:24   ` [Intel-wired-lan] [PATCH v2] " Brahmajit Das
2025-09-02  7:24     ` Brahmajit Das
2025-09-02  7:41     ` [Intel-wired-lan] " Vadim Fedorenko
2025-09-02  7:41       ` Vadim Fedorenko
2025-09-02 10:34     ` [Intel-wired-lan] " Vadim Fedorenko
2025-09-02 10:34       ` Vadim Fedorenko
2025-09-02 10:47       ` [Intel-wired-lan] " Brahmajit Das
2025-09-02 10:47         ` Brahmajit Das
2025-09-03  6:08     ` [Intel-wired-lan] " Loktionov, Aleksandr
2025-09-03  6:08       ` Loktionov, Aleksandr
2025-09-03  9:11       ` Brahmajit Das
2025-09-03  9:15         ` Loktionov, Aleksandr
2025-09-03  9:15           ` Loktionov, Aleksandr
2025-09-03  6:09 ` [Intel-wired-lan] [PATCH] " Loktionov, Aleksandr
2025-09-03  6:09   ` Loktionov, Aleksandr

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=e13abc99-fb35-4bc4-b110-9ddfa8cdb442@linux.dev \
    --to=vadim.fedorenko@linux.dev \
    --cc=andrew+netdev@lunn.ch \
    --cc=anthony.l.nguyen@intel.com \
    --cc=davem@davemloft.net \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=kuba@kernel.org \
    --cc=listout@listout.xyz \
    --cc=netdev@vger.kernel.org \
    --cc=przemyslaw.kitszel@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.