diff mbox series

ixgbe: remove self assignment

Message ID 20250209-e610-self-v1-1-34c6c46ffe11@ethancedwards.com (mailing list archive)
State New
Headers show
Series ixgbe: remove self assignment | expand

Commit Message

Ethan Carter Edwards Feb. 10, 2025, 4:47 a.m. UTC
Variable self assignment does not have any effect.

Addresses-Coverity-ID: 1641823 ("Self assignment")
Fixes: 46761fd52a886 ("ixgbe: Add support for E610 FW Admin Command Interface")
Signed-off-by: Ethan Carter Edwards <ethan@ethancedwards.com>
---
 drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c | 1 -
 1 file changed, 1 deletion(-)


---
base-commit: a64dcfb451e254085a7daee5fe51bf22959d52d3
change-id: 20250209-e610-self-85eac1f0e338

Best regards,

Comments

Michal Swiatkowski Feb. 10, 2025, 5:36 a.m. UTC | #1
On Sun, Feb 09, 2025 at 11:47:24PM -0500, Ethan Carter Edwards wrote:
> Variable self assignment does not have any effect.
> 
> Addresses-Coverity-ID: 1641823 ("Self assignment")
> Fixes: 46761fd52a886 ("ixgbe: Add support for E610 FW Admin Command Interface")
> Signed-off-by: Ethan Carter Edwards <ethan@ethancedwards.com>
> ---
>  drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c
> index 683c668672d65535fca3b2fe6f58a9deda1188fa..6b0bce92476c3c5ec3cf7ab79864b394b592c6d4 100644
> --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c
> +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c
> @@ -145,7 +145,6 @@ static int ixgbe_aci_send_cmd_execute(struct ixgbe_hw *hw,
>  	if ((hicr & IXGBE_PF_HICR_SV)) {
>  		for (i = 0; i < IXGBE_ACI_DESC_SIZE_IN_DWORDS; i++) {
>  			raw_desc[i] = IXGBE_READ_REG(hw, IXGBE_PF_HIDA(i));
> -			raw_desc[i] = raw_desc[i];
>  		}
>  	}
>  

Thanks for the patch. This change is already in progress [1] (I hope,
waiting for v3).

[1] https://lore.kernel.org/netdev/20250115034117.172999-1-dheeraj.linuxdev@gmail.com/

Thanks,
Michal

> 
> ---
> base-commit: a64dcfb451e254085a7daee5fe51bf22959d52d3
> change-id: 20250209-e610-self-85eac1f0e338
> 
> Best regards,
> -- 
> Ethan Carter Edwards <ethan@ethancedwards.com>
Andrew Lunn Feb. 10, 2025, 1:24 p.m. UTC | #2
On Sun, Feb 09, 2025 at 11:47:24PM -0500, Ethan Carter Edwards wrote:
> Variable self assignment does not have any effect.

Hi Ethan

As a general rule, it would be good to explain in the comment message
what research you did to find out why there is a self assignment, and
why just deleting it is the correct solution.

There are somewhat legitimate reasons to do a self assign, some older
compilers would warn about variables which were set but then never
used, for example. Or it could be a dumb copy/paste error when writing
the code. But more likely than not, the developer had something in
mind, got distracted, and never finished the code. Which appears to
the issue here.

If you cannot figure out what the correct fix is, please just email to
the list, Cc: the Maintainer of the file, pointing out the problem.

    Andrew

---
pw-bot: cr
diff mbox series

Patch

diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c
index 683c668672d65535fca3b2fe6f58a9deda1188fa..6b0bce92476c3c5ec3cf7ab79864b394b592c6d4 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c
@@ -145,7 +145,6 @@  static int ixgbe_aci_send_cmd_execute(struct ixgbe_hw *hw,
 	if ((hicr & IXGBE_PF_HICR_SV)) {
 		for (i = 0; i < IXGBE_ACI_DESC_SIZE_IN_DWORDS; i++) {
 			raw_desc[i] = IXGBE_READ_REG(hw, IXGBE_PF_HIDA(i));
-			raw_desc[i] = raw_desc[i];
 		}
 	}