[PATCH v3 115/129] net/ice/base: fix ice_get_ctx() issue
Anatoly Burakov
anatoly.burakov at intel.com
Tue Jun 25 13:14:00 CEST 2024
From: Yahui Cao <yahui.cao at intel.com>
No need to invert mask since we only reserve the masked bits instead of clear
them.
Fixes: a03c714bfe0b ("net/ice/base: add two helper functions")
Cc: qi.z.zhang at intel.com
Cc: stable at dpdk.org
Signed-off-by: Yahui Cao <yahui.cao at intel.com>
Signed-off-by: Ian Stokes <ian.stokes at intel.com>
---
drivers/net/ice/base/ice_common.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ice/base/ice_common.c b/drivers/net/ice/base/ice_common.c
index ad9b95f75e..8fcd27a594 100644
--- a/drivers/net/ice/base/ice_common.c
+++ b/drivers/net/ice/base/ice_common.c
@@ -5033,7 +5033,7 @@ ice_read_byte(u8 *src_ctx, u8 *dest_ctx, const struct ice_ctx_ele *ce_info)
ice_memcpy(&dest_byte, src, sizeof(dest_byte), ICE_NONDMA_TO_NONDMA);
- dest_byte &= ~(mask);
+ dest_byte &= mask;
dest_byte >>= shift_width;
@@ -5073,7 +5073,7 @@ ice_read_word(u8 *src_ctx, u8 *dest_ctx, const struct ice_ctx_ele *ce_info)
/* the data in the memory is stored as little endian so mask it
* correctly
*/
- src_word &= ~(CPU_TO_LE16(mask));
+ src_word &= CPU_TO_LE16(mask);
/* get the data back into host order before shifting */
dest_word = LE16_TO_CPU(src_word);
@@ -5124,7 +5124,7 @@ ice_read_dword(u8 *src_ctx, u8 *dest_ctx, const struct ice_ctx_ele *ce_info)
/* the data in the memory is stored as little endian so mask it
* correctly
*/
- src_dword &= ~(CPU_TO_LE32(mask));
+ src_dword &= CPU_TO_LE32(mask);
/* get the data back into host order before shifting */
dest_dword = LE32_TO_CPU(src_dword);
@@ -5175,7 +5175,7 @@ ice_read_qword(u8 *src_ctx, u8 *dest_ctx, const struct ice_ctx_ele *ce_info)
/* the data in the memory is stored as little endian so mask it
* correctly
*/
- src_qword &= ~(CPU_TO_LE64(mask));
+ src_qword &= CPU_TO_LE64(mask);
/* get the data back into host order before shifting */
dest_qword = LE64_TO_CPU(src_qword);
--
2.43.0
More information about the dev
mailing list