In both i40e_calc_nvm_checksum() and i40e_update_nvm_checksum(), the local variables designated by 'ret_code' are overwritten immediately. As such, they should merely be declared.
Unified · Split
| @@ -484,7 +484,7 @@ static i40e_status i40e_write_nvm_aq(struct i40e_hw *hw, u8 module_pointer, · 483 unmodified lines | |||
| 484 | static i40e_status i40e_calc_nvm_checksum(struct i40e_hw *hw, | 484 | static i40e_status i40e_calc_nvm_checksum(struct i40e_hw *hw, |
| 485 | u16 *checksum) | 485 | u16 *checksum) |
| 486 | { | 486 | { |
| 487 | i40e_status ret_code = 0; | 487 | i40e_status ret_code; |
| 488 | struct i40e_virt_mem vmem; | 488 | struct i40e_virt_mem vmem; |
| 489 | u16 pcie_alt_module = 0; | 489 | u16 pcie_alt_module = 0; |
| 490 | u16 checksum_local = 0; | 490 | u16 checksum_local = 0; |
| @@ -564,7 +564,7 @@ i40e_calc_nvm_checksum_exit: · 73 unmodified lines | |||
| 564 | **/ | 564 | **/ |
| 565 | i40e_status i40e_update_nvm_checksum(struct i40e_hw *hw) | 565 | i40e_status i40e_update_nvm_checksum(struct i40e_hw *hw) |
| 566 | { | 566 | { |
| 567 | i40e_status ret_code = 0; | 567 | i40e_status ret_code; |
| 568 | u16 checksum; | 568 | u16 checksum; |
| 569 | __le16 le_sum; | 569 | __le16 le_sum; |
| 570 | 570 | ||