Intel-Wired-Lan Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Sasha Neftin <sashaneftin@gmail.com>
To: intel-wired-lan@osuosl.org
Subject: [iwl-next, v1] igc: remove unused igc_update_nvm_checksum()
Date: Sat, 24 Oct 2026 19:37:01 +0300	[thread overview]
Message-ID: <20261024163701.134489-1-sashaneftin@gmail.com> (raw)

igc_update_nvm_checksum() has no callers in the tree. The i225 NVM
operations use their own implementation, igc_update_nvm_checksum_i225(),
which is what nvm->ops.update points to in igc_init_nvm_params_i225().

Remove the dead generic function and its prototype from igc_nvm.h.
While at it, add the include guard name as a comment to the closing #endif
in igc_nvm.h.

No functional change.

Signed-off-by: Sasha Neftin <sashaneftin@gmail.com>
---
 drivers/net/ethernet/intel/igc/igc_i225.c |  4 +--
 drivers/net/ethernet/intel/igc/igc_nvm.c  | 31 -----------------------
 drivers/net/ethernet/intel/igc/igc_nvm.h  |  3 +--
 3 files changed, 3 insertions(+), 35 deletions(-)

diff --git a/drivers/net/ethernet/intel/igc/igc_i225.c b/drivers/net/ethernet/intel/igc/igc_i225.c
index 5226d10cc95b..0971debca3a4 100644
--- a/drivers/net/ethernet/intel/igc/igc_i225.c
+++ b/drivers/net/ethernet/intel/igc/igc_i225.c
@@ -220,7 +220,7 @@ static s32 igc_read_nvm_srrd_i225(struct igc_hw *hw, u16 offset, u16 words,
  *
  * Writes data to Shadow Ram at offset using EEWR register.
  *
- * If igc_update_nvm_checksum is not called after this function , the
+ * If igc_update_nvm_checksum_i225 is not called after this function , the
  * Shadow Ram will most likely contain an invalid checksum.
  */
 static s32 igc_write_nvm_srwr(struct igc_hw *hw, u16 offset, u16 words,
@@ -275,7 +275,7 @@ static s32 igc_write_nvm_srwr(struct igc_hw *hw, u16 offset, u16 words,
  *
  * Writes data to Shadow RAM at offset using EEWR register.
  *
- * If igc_update_nvm_checksum is not called after this function , the
+ * If igc_update_nvm_checksum_i225 is not called after this function , the
  * data will not be committed to FLASH and also Shadow RAM will most likely
  * contain an invalid checksum.
  *
diff --git a/drivers/net/ethernet/intel/igc/igc_nvm.c b/drivers/net/ethernet/intel/igc/igc_nvm.c
index a47b8d39238c..b69889bfeb42 100644
--- a/drivers/net/ethernet/intel/igc/igc_nvm.c
+++ b/drivers/net/ethernet/intel/igc/igc_nvm.c
@@ -132,34 +132,3 @@ s32 igc_validate_nvm_checksum(struct igc_hw *hw)
 out:
 	return ret_val;
 }
-
-/**
- * igc_update_nvm_checksum - Update EEPROM checksum
- * @hw: pointer to the HW structure
- *
- * Updates the EEPROM checksum by reading/adding each word of the EEPROM
- * up to the checksum.  Then calculates the EEPROM checksum and writes the
- * value to the EEPROM.
- */
-s32 igc_update_nvm_checksum(struct igc_hw *hw)
-{
-	u16 checksum = 0;
-	u16 i, nvm_data;
-	s32  ret_val;
-
-	for (i = 0; i < NVM_CHECKSUM_REG; i++) {
-		ret_val = hw->nvm.ops.read(hw, i, 1, &nvm_data);
-		if (ret_val) {
-			hw_dbg("NVM Read Error while updating checksum.\n");
-			goto out;
-		}
-		checksum += nvm_data;
-	}
-	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");
-
-out:
-	return ret_val;
-}
diff --git a/drivers/net/ethernet/intel/igc/igc_nvm.h b/drivers/net/ethernet/intel/igc/igc_nvm.h
index ab78d0c64547..d5f1f1a449eb 100644
--- a/drivers/net/ethernet/intel/igc/igc_nvm.h
+++ b/drivers/net/ethernet/intel/igc/igc_nvm.h
@@ -7,6 +7,5 @@
 s32 igc_read_mac_addr(struct igc_hw *hw);
 s32 igc_read_nvm_eerd(struct igc_hw *hw, u16 offset, u16 words, u16 *data);
 s32 igc_validate_nvm_checksum(struct igc_hw *hw);
-s32 igc_update_nvm_checksum(struct igc_hw *hw);
 
-#endif
+#endif /* _IGC_NVM_H_ */
-- 
2.53.0


             reply	other threads:[~2026-10-24 16:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-24 16:37 Sasha Neftin [this message]
2026-10-24 16:40 ` [iwl-next, v1] igc: remove unused igc_update_nvm_checksum() Paul Menzel
2026-10-27  9:18   ` Sasha Neftin
2026-10-26 22: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=20261024163701.134489-1-sashaneftin@gmail.com \
    --to=sashaneftin@gmail.com \
    --cc=intel-wired-lan@osuosl.org \
    /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