projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0e5229c
)
i40e: fix unconditional execution of cpu_to_le16()
author
Jean Sacren
<
[email protected]
>
Tue, 13 Oct 2015 07:06:32 +0000
(
01:06
-0600)
committer
Jeff Kirsher
<
[email protected]
>
Fri, 23 Oct 2015 12:40:49 +0000
(
05:40
-0700)
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.
Cc: Jesse Brandeburg <
[email protected]
>
Cc: Paul M Stillwell Jr <
[email protected]
>
Signed-off-by: Jean Sacren <
[email protected]
>
Tested-by: Andrew Bowers <
[email protected]
>
Signed-off-by: Jeff Kirsher <
[email protected]
>
drivers/net/ethernet/intel/i40e/i40e_nvm.c
patch
|
blob
|
history
diff --git
a/drivers/net/ethernet/intel/i40e/i40e_nvm.c
b/drivers/net/ethernet/intel/i40e/i40e_nvm.c
index 1715358a8a6c3c090cca70c4544d6e576e8d967e..6100cdd9ad13b420f20a640f8dc2572b89afb92d 100644
(file)
--- a/
drivers/net/ethernet/intel/i40e/i40e_nvm.c
+++ b/
drivers/net/ethernet/intel/i40e/i40e_nvm.c
@@
-569,10
+569,11
@@
i40e_status i40e_update_nvm_checksum(struct i40e_hw *hw)
__le16 le_sum;
ret_code = i40e_calc_nvm_checksum(hw, &checksum);
- le_sum = cpu_to_le16(checksum);
- if (!ret_code)
+ if (!ret_code) {
+ le_sum = cpu_to_le16(checksum);
ret_code = i40e_write_nvm_aq(hw, 0x00, I40E_SR_SW_CHECKSUM_WORD,
1, &le_sum, true);
+ }
return ret_code;
}