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 <[email protected]> --- 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
