net/ice/base: silence static analysis warning
authorQi Zhang <qi.z.zhang@intel.com>
Wed, 26 Aug 2020 06:44:33 +0000 (14:44 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 18 Sep 2020 16:55:09 +0000 (18:55 +0200)
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
drivers/net/ice/base/ice_switch.c

index 2befe68..22d7d94 100644 (file)
@@ -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;
 
index e0eebe3..8759224 100644 (file)
@@ -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++;
                }