linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/4] e1000: drop checksum constant cast to u16 in comparisons
@ 2025-06-24 19:29 Jacek Kowalski
  2025-06-24 19:30 ` [PATCH 2/4] e1000e: " Jacek Kowalski
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Jacek Kowalski @ 2025-06-24 19:29 UTC (permalink / raw)
  To: Tony Nguyen, Przemek Kitszel, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Simon Horman
  Cc: intel-wired-lan, netdev, linux-kernel

Signed-off-by: Jacek Kowalski <Jacek@jacekk.info>
Suggested-by: Simon Horman <horms@kernel.org>
---
 drivers/net/ethernet/intel/e1000/e1000_ethtool.c | 2 +-
 drivers/net/ethernet/intel/e1000/e1000_hw.c      | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/intel/e1000/e1000_ethtool.c b/drivers/net/ethernet/intel/e1000/e1000_ethtool.c
index d06d29c6c037..d152026a027b 100644
--- a/drivers/net/ethernet/intel/e1000/e1000_ethtool.c
+++ b/drivers/net/ethernet/intel/e1000/e1000_ethtool.c
@@ -806,7 +806,7 @@ static int e1000_eeprom_test(struct e1000_adapter *adapter, u64 *data)
 	}
 
 	/* If Checksum is not Correct return error else test passed */
-	if ((checksum != (u16)EEPROM_SUM) && !(*data))
+	if ((checksum != EEPROM_SUM) && !(*data))
 		*data = 2;
 
 	return *data;
diff --git a/drivers/net/ethernet/intel/e1000/e1000_hw.c b/drivers/net/ethernet/intel/e1000/e1000_hw.c
index f9328f2e669f..b5a31e8d84f4 100644
--- a/drivers/net/ethernet/intel/e1000/e1000_hw.c
+++ b/drivers/net/ethernet/intel/e1000/e1000_hw.c
@@ -3970,7 +3970,7 @@ s32 e1000_validate_eeprom_checksum(struct e1000_hw *hw)
 		return E1000_SUCCESS;
 
 #endif
-	if (checksum == (u16)EEPROM_SUM)
+	if (checksum == EEPROM_SUM)
 		return E1000_SUCCESS;
 	else {
 		e_dbg("EEPROM Checksum Invalid\n");
-- 
2.47.2


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 2/4] e1000e: drop checksum constant cast to u16 in comparisons
  2025-06-24 19:29 [PATCH 1/4] e1000: drop checksum constant cast to u16 in comparisons Jacek Kowalski
@ 2025-06-24 19:30 ` Jacek Kowalski
  2025-06-24 19:30 ` [PATCH 3/4] igb: " Jacek Kowalski
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 10+ messages in thread
From: Jacek Kowalski @ 2025-06-24 19:30 UTC (permalink / raw)
  To: Tony Nguyen, Przemek Kitszel, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Simon Horman
  Cc: intel-wired-lan, netdev, linux-kernel

Signed-off-by: Jacek Kowalski <Jacek@jacekk.info>
Suggested-by: Simon Horman <horms@kernel.org>
---
 drivers/net/ethernet/intel/e1000e/ethtool.c | 2 +-
 drivers/net/ethernet/intel/e1000e/nvm.c     | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/intel/e1000e/ethtool.c b/drivers/net/ethernet/intel/e1000e/ethtool.c
index 9364bc2b4eb1..80435577dc0d 100644
--- a/drivers/net/ethernet/intel/e1000e/ethtool.c
+++ b/drivers/net/ethernet/intel/e1000e/ethtool.c
@@ -959,7 +959,7 @@ static int e1000_eeprom_test(struct e1000_adapter *adapter, u64 *data)
 	}
 
 	/* If Checksum is not Correct return error else test passed */
-	if ((checksum != (u16)NVM_SUM) && !(*data))
+	if ((checksum != NVM_SUM) && !(*data))
 		*data = 2;
 
 	return *data;
diff --git a/drivers/net/ethernet/intel/e1000e/nvm.c b/drivers/net/ethernet/intel/e1000e/nvm.c
index 56f2434bd00a..d1bc69984d71 100644
--- a/drivers/net/ethernet/intel/e1000e/nvm.c
+++ b/drivers/net/ethernet/intel/e1000e/nvm.c
@@ -563,7 +563,7 @@ s32 e1000e_validate_nvm_checksum_generic(struct e1000_hw *hw)
 		return 0;
 	}
 
-	if (checksum != (u16)NVM_SUM) {
+	if (checksum != NVM_SUM) {
 		e_dbg("NVM Checksum Invalid\n");
 		return -E1000_ERR_NVM;
 	}
-- 
2.47.2


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 3/4] igb: drop checksum constant cast to u16 in comparisons
  2025-06-24 19:29 [PATCH 1/4] e1000: drop checksum constant cast to u16 in comparisons Jacek Kowalski
  2025-06-24 19:30 ` [PATCH 2/4] e1000e: " Jacek Kowalski
@ 2025-06-24 19:30 ` Jacek Kowalski
  2025-06-25 12:21   ` Simon Horman
  2025-06-24 19:31 ` [PATCH 4/4] igc: " Jacek Kowalski
  2025-06-25 12:18 ` [PATCH 1/4] e1000: " Simon Horman
  3 siblings, 1 reply; 10+ messages in thread
From: Jacek Kowalski @ 2025-06-24 19:30 UTC (permalink / raw)
  To: Tony Nguyen, Przemek Kitszel, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Simon Horman
  Cc: intel-wired-lan, netdev, linux-kernel

Signed-off-by: Jacek Kowalski <Jacek@jacekk.info>
Suggested-by: Simon Horman <horms@kernel.org>
---
 drivers/net/ethernet/intel/igb/e1000_82575.c | 2 +-
 drivers/net/ethernet/intel/igb/e1000_nvm.c   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/intel/igb/e1000_82575.c b/drivers/net/ethernet/intel/igb/e1000_82575.c
index 64dfc362d1dc..12ad1dc90169 100644
--- a/drivers/net/ethernet/intel/igb/e1000_82575.c
+++ b/drivers/net/ethernet/intel/igb/e1000_82575.c
@@ -2372,7 +2372,7 @@ static s32 igb_validate_nvm_checksum_with_offset(struct e1000_hw *hw,
 		checksum += nvm_data;
 	}
 
-	if (checksum != (u16) NVM_SUM) {
+	if (checksum != NVM_SUM) {
 		hw_dbg("NVM Checksum Invalid\n");
 		ret_val = -E1000_ERR_NVM;
 		goto out;
diff --git a/drivers/net/ethernet/intel/igb/e1000_nvm.c b/drivers/net/ethernet/intel/igb/e1000_nvm.c
index 2dcd64d6dec3..e654310b1161 100644
--- a/drivers/net/ethernet/intel/igb/e1000_nvm.c
+++ b/drivers/net/ethernet/intel/igb/e1000_nvm.c
@@ -636,7 +636,7 @@ s32 igb_validate_nvm_checksum(struct e1000_hw *hw)
 		checksum += nvm_data;
 	}
 
-	if (checksum != (u16) NVM_SUM) {
+	if (checksum != NVM_SUM) {
 		hw_dbg("NVM Checksum Invalid\n");
 		ret_val = -E1000_ERR_NVM;
 		goto out;
-- 
2.47.2


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 4/4] igc: drop checksum constant cast to u16 in comparisons
  2025-06-24 19:29 [PATCH 1/4] e1000: drop checksum constant cast to u16 in comparisons Jacek Kowalski
  2025-06-24 19:30 ` [PATCH 2/4] e1000e: " Jacek Kowalski
  2025-06-24 19:30 ` [PATCH 3/4] igb: " Jacek Kowalski
@ 2025-06-24 19:31 ` Jacek Kowalski
  2025-06-25 12:22   ` Simon Horman
  2025-06-25 12:18 ` [PATCH 1/4] e1000: " Simon Horman
  3 siblings, 1 reply; 10+ messages in thread
From: Jacek Kowalski @ 2025-06-24 19:31 UTC (permalink / raw)
  To: Tony Nguyen, Przemek Kitszel, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Simon Horman
  Cc: intel-wired-lan, netdev, linux-kernel

Signed-off-by: Jacek Kowalski <Jacek@jacekk.info>
Suggested-by: Simon Horman <horms@kernel.org>
---
 drivers/net/ethernet/intel/igc/igc_nvm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/igc/igc_nvm.c b/drivers/net/ethernet/intel/igc/igc_nvm.c
index efd121c03967..c4fb35071636 100644
--- a/drivers/net/ethernet/intel/igc/igc_nvm.c
+++ b/drivers/net/ethernet/intel/igc/igc_nvm.c
@@ -123,7 +123,7 @@ s32 igc_validate_nvm_checksum(struct igc_hw *hw)
 		checksum += nvm_data;
 	}
 
-	if (checksum != (u16)NVM_SUM) {
+	if (checksum != NVM_SUM) {
 		hw_dbg("NVM Checksum Invalid\n");
 		ret_val = -IGC_ERR_NVM;
 		goto out;
-- 
2.47.2


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH 1/4] e1000: drop checksum constant cast to u16 in comparisons
  2025-06-24 19:29 [PATCH 1/4] e1000: drop checksum constant cast to u16 in comparisons Jacek Kowalski
                   ` (2 preceding siblings ...)
  2025-06-24 19:31 ` [PATCH 4/4] igc: " Jacek Kowalski
@ 2025-06-25 12:18 ` Simon Horman
  2025-06-25 12:19   ` Simon Horman
  2025-06-25 13:03   ` Jacek Kowalski
  3 siblings, 2 replies; 10+ messages in thread
From: Simon Horman @ 2025-06-25 12:18 UTC (permalink / raw)
  To: Jacek Kowalski
  Cc: Tony Nguyen, Przemek Kitszel, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, intel-wired-lan,
	netdev, linux-kernel

On Tue, Jun 24, 2025 at 09:29:43PM +0200, Jacek Kowalski wrote:

Hi Jacek,

Thanks for the patchset.

Some feedback at a high level:

1. It's normal for patch-sets, to have a cover letter.
   That provides a handy place for high level comments,
   perhaps ironically, such as this one.

2. Please provide some text in the patch description.
   I know these changes are trivial. But we'd like to have something there.
   E.g.

   Remove unnecessary cast of constants to u16,
   allowing the C type system to do it's thing.

   No behavioural change intended.
   Compile tested only.

3. This patchset should probably be targeted at iwl-next, like this:

	Subject: [PATCH iwl-next] ...

4. Please make sure the patchset applies cleanly to it's target tree.
   It seems that in it's current form the patchset doesn't
   apply to iwl-next or net-next.

5. It's up to you. But in general there is no need
   to CC linux-kernel@vger.kernel.org on Networking patches

> Signed-off-by: Jacek Kowalski <Jacek@jacekk.info>
> Suggested-by: Simon Horman <horms@kernel.org>

As for this patch itself, it looks good to me.
But I think you missed two.

diff --git a/drivers/net/ethernet/intel/e1000/e1000_hw.c b/drivers/net/ethernet/intel/e1000/e1000_hw.c
index b5a31e8d84f4..0e5de52b1067 100644
--- a/drivers/net/ethernet/intel/e1000/e1000_hw.c
+++ b/drivers/net/ethernet/intel/e1000/e1000_hw.c
@@ -3997,7 +3997,7 @@ s32 e1000_update_eeprom_checksum(struct e1000_hw *hw)
 		}
 		checksum += eeprom_data;
 	}
-	checksum = (u16)EEPROM_SUM - checksum;
+	checksum = EEPROM_SUM - checksum;
 	if (e1000_write_eeprom(hw, EEPROM_CHECKSUM_REG, 1, &checksum) < 0) {
 		e_dbg("EEPROM Write Error\n");
 		return -E1000_ERR_EEPROM;
diff --git a/drivers/net/ethernet/intel/e1000e/nvm.c b/drivers/net/ethernet/intel/e1000e/nvm.c
index 1c9071396b3c..556dbefdcef9 100644
--- a/drivers/net/ethernet/intel/e1000e/nvm.c
+++ b/drivers/net/ethernet/intel/e1000e/nvm.c
@@ -588,7 +588,7 @@ s32 e1000e_update_nvm_checksum_generic(struct e1000_hw *hw)
 		}
 		checksum += nvm_data;
 	}
-	checksum = (u16)NVM_SUM - checksum;
+	checksum = NVM_SUM - checksum;
 	ret_val = e1000_write_nvm(hw, NVM_CHECKSUM_REG, 1, &checksum);
 	if (ret_val)
 		e_dbg("NVM Write Error while updating checksum.\n");

-- 
pw-bot: changes-requested

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH 1/4] e1000: drop checksum constant cast to u16 in comparisons
  2025-06-25 12:18 ` [PATCH 1/4] e1000: " Simon Horman
@ 2025-06-25 12:19   ` Simon Horman
  2025-06-25 13:03   ` Jacek Kowalski
  1 sibling, 0 replies; 10+ messages in thread
From: Simon Horman @ 2025-06-25 12:19 UTC (permalink / raw)
  To: Jacek Kowalski
  Cc: Tony Nguyen, Przemek Kitszel, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, intel-wired-lan,
	netdev, linux-kernel

On Wed, Jun 25, 2025 at 01:18:28PM +0100, Simon Horman wrote:
> On Tue, Jun 24, 2025 at 09:29:43PM +0200, Jacek Kowalski wrote:
> 
> Hi Jacek,
> 
> Thanks for the patchset.
> 
> Some feedback at a high level:
> 
> 1. It's normal for patch-sets, to have a cover letter.
>    That provides a handy place for high level comments,
>    perhaps ironically, such as this one.
> 
> 2. Please provide some text in the patch description.
>    I know these changes are trivial. But we'd like to have something there.
>    E.g.
> 
>    Remove unnecessary cast of constants to u16,
>    allowing the C type system to do it's thing.
> 
>    No behavioural change intended.
>    Compile tested only.
> 
> 3. This patchset should probably be targeted at iwl-next, like this:
> 
> 	Subject: [PATCH iwl-next] ...
> 
> 4. Please make sure the patchset applies cleanly to it's target tree.
>    It seems that in it's current form the patchset doesn't
>    apply to iwl-next or net-next.
> 
> 5. It's up to you. But in general there is no need
>    to CC linux-kernel@vger.kernel.org on Networking patches
> 
> > Signed-off-by: Jacek Kowalski <Jacek@jacekk.info>
> > Suggested-by: Simon Horman <horms@kernel.org>
> 
> As for this patch itself, it looks good to me.
> But I think you missed two.
> 
> diff --git a/drivers/net/ethernet/intel/e1000/e1000_hw.c b/drivers/net/ethernet/intel/e1000/e1000_hw.c
> index b5a31e8d84f4..0e5de52b1067 100644
> --- a/drivers/net/ethernet/intel/e1000/e1000_hw.c
> +++ b/drivers/net/ethernet/intel/e1000/e1000_hw.c
> @@ -3997,7 +3997,7 @@ s32 e1000_update_eeprom_checksum(struct e1000_hw *hw)
>  		}
>  		checksum += eeprom_data;
>  	}
> -	checksum = (u16)EEPROM_SUM - checksum;
> +	checksum = EEPROM_SUM - checksum;
>  	if (e1000_write_eeprom(hw, EEPROM_CHECKSUM_REG, 1, &checksum) < 0) {
>  		e_dbg("EEPROM Write Error\n");
>  		return -E1000_ERR_EEPROM;
> diff --git a/drivers/net/ethernet/intel/e1000e/nvm.c b/drivers/net/ethernet/intel/e1000e/nvm.c
> index 1c9071396b3c..556dbefdcef9 100644
> --- a/drivers/net/ethernet/intel/e1000e/nvm.c
> +++ b/drivers/net/ethernet/intel/e1000e/nvm.c
> @@ -588,7 +588,7 @@ s32 e1000e_update_nvm_checksum_generic(struct e1000_hw *hw)
>  		}
>  		checksum += nvm_data;
>  	}
> -	checksum = (u16)NVM_SUM - checksum;
> +	checksum = NVM_SUM - checksum;
>  	ret_val = e1000_write_nvm(hw, NVM_CHECKSUM_REG, 1, &checksum);
>  	if (ret_val)
>  		e_dbg("NVM Write Error while updating checksum.\n");

Sorry, I now see that the 2nd of the two hunks above is for patch 2/4.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 3/4] igb: drop checksum constant cast to u16 in comparisons
  2025-06-24 19:30 ` [PATCH 3/4] igb: " Jacek Kowalski
@ 2025-06-25 12:21   ` Simon Horman
  0 siblings, 0 replies; 10+ messages in thread
From: Simon Horman @ 2025-06-25 12:21 UTC (permalink / raw)
  To: Jacek Kowalski
  Cc: Tony Nguyen, Przemek Kitszel, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, intel-wired-lan,
	netdev, linux-kernel

On Tue, Jun 24, 2025 at 09:30:44PM +0200, Jacek Kowalski wrote:

As per my comment on patch 1/4, some text should go here.

> Signed-off-by: Jacek Kowalski <Jacek@jacekk.info>
> Suggested-by: Simon Horman <horms@kernel.org>
> ---
>  drivers/net/ethernet/intel/igb/e1000_82575.c | 2 +-
>  drivers/net/ethernet/intel/igb/e1000_nvm.c   | 2 +-

These changes look good to me, but I think we should also do:

diff --git a/drivers/net/ethernet/intel/igb/e1000_82575.c b/drivers/net/ethernet/intel/igb/e1000_82575.c
index 12ad1dc90169..44a85ad749a4 100644
--- a/drivers/net/ethernet/intel/igb/e1000_82575.c
+++ b/drivers/net/ethernet/intel/igb/e1000_82575.c
@@ -2406,7 +2406,7 @@ static s32 igb_update_nvm_checksum_with_offset(struct e1000_hw *hw, u16 offset)
 		}
 		checksum += nvm_data;
 	}
-	checksum = (u16) NVM_SUM - checksum;
+	checksum = NVM_SUM - checksum;
 	ret_val = hw->nvm.ops.write(hw, (NVM_CHECKSUM_REG + offset), 1,
 				&checksum);
 	if (ret_val)
diff --git a/drivers/net/ethernet/intel/igb/e1000_nvm.c b/drivers/net/ethernet/intel/igb/e1000_nvm.c
index e654310b1161..c8638502c2be 100644
--- a/drivers/net/ethernet/intel/igb/e1000_nvm.c
+++ b/drivers/net/ethernet/intel/igb/e1000_nvm.c
@@ -668,7 +668,7 @@ s32 igb_update_nvm_checksum(struct e1000_hw *hw)
 		}
 		checksum += nvm_data;
 	}
-	checksum = (u16) NVM_SUM - checksum;
+	checksum = NVM_SUM - checksum;
 	ret_val = hw->nvm.ops.write(hw, NVM_CHECKSUM_REG, 1, &checksum);
 	if (ret_val)
 		hw_dbg("NVM Write Error while updating checksum.\n");


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH 4/4] igc: drop checksum constant cast to u16 in comparisons
  2025-06-24 19:31 ` [PATCH 4/4] igc: " Jacek Kowalski
@ 2025-06-25 12:22   ` Simon Horman
  2025-06-25 16:12     ` David Laight
  0 siblings, 1 reply; 10+ messages in thread
From: Simon Horman @ 2025-06-25 12:22 UTC (permalink / raw)
  To: Jacek Kowalski
  Cc: Tony Nguyen, Przemek Kitszel, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, intel-wired-lan,
	netdev, linux-kernel

On Tue, Jun 24, 2025 at 09:31:08PM +0200, Jacek Kowalski wrote:
> Signed-off-by: Jacek Kowalski <Jacek@jacekk.info>
> Suggested-by: Simon Horman <horms@kernel.org>
> ---
>  drivers/net/ethernet/intel/igc/igc_nvm.c | 2 +-

I think we should add this:

diff --git a/drivers/net/ethernet/intel/igc/igc_nvm.c b/drivers/net/ethernet/intel/igc/igc_nvm.c
index c4fb35071636..a47b8d39238c 100644
--- a/drivers/net/ethernet/intel/igc/igc_nvm.c
+++ b/drivers/net/ethernet/intel/igc/igc_nvm.c
@@ -155,7 +155,7 @@ s32 igc_update_nvm_checksum(struct igc_hw *hw)
 		}
 		checksum += nvm_data;
 	}
-	checksum = (u16)NVM_SUM - checksum;
+	checksum = NVM_SUM - checksum;
 	ret_val = hw->nvm.ops.write(hw, NVM_CHECKSUM_REG, 1, &checksum);
 	if (ret_val)
 		hw_dbg("NVM Write Error while updating checksum.\n");

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH 1/4] e1000: drop checksum constant cast to u16 in comparisons
  2025-06-25 12:18 ` [PATCH 1/4] e1000: " Simon Horman
  2025-06-25 12:19   ` Simon Horman
@ 2025-06-25 13:03   ` Jacek Kowalski
  1 sibling, 0 replies; 10+ messages in thread
From: Jacek Kowalski @ 2025-06-25 13:03 UTC (permalink / raw)
  To: Simon Horman
  Cc: Tony Nguyen, Przemek Kitszel, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, intel-wired-lan,
	netdev, linux-kernel

Hey,

> 1. It's normal for patch-sets, to have a cover letter.
>    That provides a handy place for high level comments,
>    perhaps ironically, such as this one.

I'll add it in a second iteration.


> 2. Please provide some text in the patch description.
>    I know these changes are trivial. But we'd like to have something there.
>    E.g.
> 
>    Remove unnecessary cast of constants to u16,
>    allowing the C type system to do it's thing.
> 
>    No behavioural change intended.
>    Compile tested only.

Wilco.


> 4. Please make sure the patchset applies cleanly to it's target tree.
>    It seems that in it's current form the patchset doesn't
>    apply to iwl-next or net-next.

Just to be sure, iwl-next is this one:
git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/linux.git
refs/heads/for-next
?


> 5. It's up to you. But in general there is no need
>    to CC linux-kernel@vger.kernel.org on Networking patches

I've just followed get_maintainers.pl output to the letter.


> As for this patch itself, it looks good to me.
> But I think you missed two.

Rather: I have not touched subtraction on purpose.

But checking the compiler output - yes, it can be dropped as well.

I'll prepare an updated patch set with subtraction changes across Intel drivers included.

-- 
Best regards,
  Jacek Kowalski


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 4/4] igc: drop checksum constant cast to u16 in comparisons
  2025-06-25 12:22   ` Simon Horman
@ 2025-06-25 16:12     ` David Laight
  0 siblings, 0 replies; 10+ messages in thread
From: David Laight @ 2025-06-25 16:12 UTC (permalink / raw)
  To: Simon Horman
  Cc: Jacek Kowalski, Tony Nguyen, Przemek Kitszel, Andrew Lunn,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	intel-wired-lan, netdev, linux-kernel

On Wed, 25 Jun 2025 13:22:39 +0100
Simon Horman <horms@kernel.org> wrote:

> On Tue, Jun 24, 2025 at 09:31:08PM +0200, Jacek Kowalski wrote:
> > Signed-off-by: Jacek Kowalski <Jacek@jacekk.info>
> > Suggested-by: Simon Horman <horms@kernel.org>
> > ---
> >  drivers/net/ethernet/intel/igc/igc_nvm.c | 2 +-  
> 
> I think we should add this:
> 
> diff --git a/drivers/net/ethernet/intel/igc/igc_nvm.c b/drivers/net/ethernet/intel/igc/igc_nvm.c
> index c4fb35071636..a47b8d39238c 100644
> --- a/drivers/net/ethernet/intel/igc/igc_nvm.c
> +++ b/drivers/net/ethernet/intel/igc/igc_nvm.c
> @@ -155,7 +155,7 @@ s32 igc_update_nvm_checksum(struct igc_hw *hw)
>  		}
>  		checksum += nvm_data;
>  	}
> -	checksum = (u16)NVM_SUM - checksum;
> +	checksum = NVM_SUM - checksum;

Indeed - especially as the '-' code is really:
	checksum = (int)(u16)NVM_SUM - checksum;

  David


>  	ret_val = hw->nvm.ops.write(hw, NVM_CHECKSUM_REG, 1, &checksum);
>  	if (ret_val)
>  		hw_dbg("NVM Write Error while updating checksum.\n");
> 


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2025-06-25 16:12 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-24 19:29 [PATCH 1/4] e1000: drop checksum constant cast to u16 in comparisons Jacek Kowalski
2025-06-24 19:30 ` [PATCH 2/4] e1000e: " Jacek Kowalski
2025-06-24 19:30 ` [PATCH 3/4] igb: " Jacek Kowalski
2025-06-25 12:21   ` Simon Horman
2025-06-24 19:31 ` [PATCH 4/4] igc: " Jacek Kowalski
2025-06-25 12:22   ` Simon Horman
2025-06-25 16:12     ` David Laight
2025-06-25 12:18 ` [PATCH 1/4] e1000: " Simon Horman
2025-06-25 12:19   ` Simon Horman
2025-06-25 13:03   ` Jacek Kowalski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).