The commit 3092e5e4cc79 ("i40e: add little endian conversion for checksum") fixed the checksum bug on big-endian architecture. But we should not execute cpu_to_le16() unconditionally. Thus, put cpu_to_le16() under certain condition.
Unified · Split
| @@ -569,10 +569,11 @@ i40e_status i40e_update_nvm_checksum(struct i40e_hw *hw) · 568 unmodified lines | ||
| 569 | 569 | __le16 le_sum; |
| 570 | 570 | |
| 571 | 571 | ret_code = i40e_calc_nvm_checksum(hw, &checksum); |
| 572 | − le_sum = cpu_to_le16(checksum); | |
| 573 | − if (!ret_code) | |
| 572 | + if (!ret_code) { | |
| 573 | + le_sum = cpu_to_le16(checksum); | |
| 574 | 574 | ret_code = i40e_write_nvm_aq(hw, 0x00, I40E_SR_SW_CHECKSUM_WORD, |
| 575 | 575 | 1, &le_sum, true); |
| 576 | + } | |
| 576 | 577 | |
| 577 | 578 | return ret_code; |
| 578 | 579 | } |