[v2,08/40] net/ice/base: silence static analysis warning
diff mbox series

Message ID 20200911131954.15999-9-qi.z.zhang@intel.com
State Accepted, archived
Headers show
Series
  • ice base code update
Related show

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Zhang, Qi Z Sept. 11, 2020, 1:19 p.m. UTC
Sparse warns about these casts to/from restricted types which are not
actual problems; silence the warnings.

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
---
 drivers/net/ice/base/ice_nvm.c    | 2 +-
 drivers/net/ice/base/ice_switch.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Patch
diff mbox series

diff --git a/drivers/net/ice/base/ice_nvm.c b/drivers/net/ice/base/ice_nvm.c
index 2befe68d7..22d7d9439 100644
--- a/drivers/net/ice/base/ice_nvm.c
+++ b/drivers/net/ice/base/ice_nvm.c
@@ -138,7 +138,7 @@  ice_read_sr_word_aq(struct ice_hw *hw, u16 offset, u16 *data)
 	 * boundary
 	 */
 	status = ice_read_flat_nvm(hw, offset * sizeof(u16), &bytes,
-				   (u8 *)&data_local, true);
+				   (_FORCE_ u8 *)&data_local, true);
 	if (status)
 		return status;
 
diff --git a/drivers/net/ice/base/ice_switch.c b/drivers/net/ice/base/ice_switch.c
index e0eebe3d5..875922459 100644
--- a/drivers/net/ice/base/ice_switch.c
+++ b/drivers/net/ice/base/ice_switch.c
@@ -5774,7 +5774,7 @@  ice_fill_valid_words(struct ice_adv_lkup_elem *rule,
 			lkup_exts->fv_words[word].prot_id =
 				ice_prot_id_tbl[rule->type].protocol_id;
 			lkup_exts->field_mask[word] =
-				BE16_TO_CPU(((__be16 *)&rule->m_u)[j]);
+				BE16_TO_CPU(((_FORCE_ __be16 *)&rule->m_u)[j]);
 			word++;
 		}