ice: remove unnecessary casts
authorBruce Allan <bruce.w.allan@intel.com>
Sat, 21 Nov 2020 00:39:37 +0000 (16:39 -0800)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Tue, 9 Feb 2021 00:27:01 +0000 (16:27 -0800)
Casting a void * rvalue in an assignment is unnecessary in C; remove the
casts.

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Tested-by: Tony Brelinski <tonyx.brelinski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
drivers/net/ethernet/intel/ice/ice_common.c
drivers/net/ethernet/intel/ice/ice_controlq.c
drivers/net/ethernet/intel/ice/ice_flex_pipe.c
drivers/net/ethernet/intel/ice/ice_switch.c

index e9b40cdfeb0ce989a4e3979a96a5b53f5f2fbe25..3d9475e222cda6fc8c44505feacb38aa837d7e71 100644 (file)
@@ -110,7 +110,7 @@ ice_aq_manage_mac_read(struct ice_hw *hw, void *buf, u16 buf_size,
        if (status)
                return status;
 
-       resp = (struct ice_aqc_manage_mac_read_resp *)buf;
+       resp = buf;
        flags = le16_to_cpu(cmd->flags) & ICE_AQC_MAN_MAC_READ_M;
 
        if (!(flags & ICE_AQC_MAN_MAC_LAN_ADDR_VALID)) {
@@ -1980,7 +1980,7 @@ ice_parse_func_caps(struct ice_hw *hw, struct ice_hw_func_caps *func_p,
        struct ice_aqc_list_caps_elem *cap_resp;
        u32 i;
 
-       cap_resp = (struct ice_aqc_list_caps_elem *)buf;
+       cap_resp = buf;
 
        memset(func_p, 0, sizeof(*func_p));
 
@@ -2110,7 +2110,7 @@ ice_parse_dev_caps(struct ice_hw *hw, struct ice_hw_dev_caps *dev_p,
        struct ice_aqc_list_caps_elem *cap_resp;
        u32 i;
 
-       cap_resp = (struct ice_aqc_list_caps_elem *)buf;
+       cap_resp = buf;
 
        memset(dev_p, 0, sizeof(*dev_p));
 
index 4db12d1f58088e5d8cb7d85d81dc78026759d658..b2d8a5932b1de97d2294d89eb363b5bc546b350d 100644 (file)
@@ -838,7 +838,7 @@ static u16 ice_clean_sq(struct ice_hw *hw, struct ice_ctl_q_info *cq)
  */
 static void ice_debug_cq(struct ice_hw *hw, void *desc, void *buf, u16 buf_len)
 {
-       struct ice_aq_desc *cq_desc = (struct ice_aq_desc *)desc;
+       struct ice_aq_desc *cq_desc = desc;
        u16 len;
 
        if (!IS_ENABLED(CONFIG_DYNAMIC_DEBUG) &&
@@ -868,7 +868,7 @@ static void ice_debug_cq(struct ice_hw *hw, void *desc, void *buf, u16 buf_len)
                if (buf_len < len)
                        len = buf_len;
 
-               ice_debug_array(hw, ICE_DBG_AQ_DESC_BUF, 16, 1, (u8 *)buf, len);
+               ice_debug_array(hw, ICE_DBG_AQ_DESC_BUF, 16, 1, buf, len);
        }
 }
 
index cf5b717b92931b34d6871af1ab96aac610abb301..5e1fd30c0a0fc918c254ac7bf87b5103de3522fb 100644 (file)
@@ -2727,7 +2727,7 @@ static void ice_fill_tbl(struct ice_hw *hw, enum ice_block block_id, u32 sid)
                case ICE_SID_XLT1_RSS:
                case ICE_SID_XLT1_ACL:
                case ICE_SID_XLT1_PE:
-                       xlt1 = (struct ice_xlt1_section *)sect;
+                       xlt1 = sect;
                        src = xlt1->value;
                        sect_len = le16_to_cpu(xlt1->count) *
                                sizeof(*hw->blk[block_id].xlt1.t);
@@ -2740,7 +2740,7 @@ static void ice_fill_tbl(struct ice_hw *hw, enum ice_block block_id, u32 sid)
                case ICE_SID_XLT2_RSS:
                case ICE_SID_XLT2_ACL:
                case ICE_SID_XLT2_PE:
-                       xlt2 = (struct ice_xlt2_section *)sect;
+                       xlt2 = sect;
                        src = (__force u8 *)xlt2->value;
                        sect_len = le16_to_cpu(xlt2->count) *
                                sizeof(*hw->blk[block_id].xlt2.t);
@@ -2753,7 +2753,7 @@ static void ice_fill_tbl(struct ice_hw *hw, enum ice_block block_id, u32 sid)
                case ICE_SID_PROFID_TCAM_RSS:
                case ICE_SID_PROFID_TCAM_ACL:
                case ICE_SID_PROFID_TCAM_PE:
-                       pid = (struct ice_prof_id_section *)sect;
+                       pid = sect;
                        src = (u8 *)pid->entry;
                        sect_len = le16_to_cpu(pid->count) *
                                sizeof(*hw->blk[block_id].prof.t);
@@ -2766,7 +2766,7 @@ static void ice_fill_tbl(struct ice_hw *hw, enum ice_block block_id, u32 sid)
                case ICE_SID_PROFID_REDIR_RSS:
                case ICE_SID_PROFID_REDIR_ACL:
                case ICE_SID_PROFID_REDIR_PE:
-                       pr = (struct ice_prof_redir_section *)sect;
+                       pr = sect;
                        src = pr->redir_value;
                        sect_len = le16_to_cpu(pr->count) *
                                sizeof(*hw->blk[block_id].prof_redir.t);
@@ -2779,7 +2779,7 @@ static void ice_fill_tbl(struct ice_hw *hw, enum ice_block block_id, u32 sid)
                case ICE_SID_FLD_VEC_RSS:
                case ICE_SID_FLD_VEC_ACL:
                case ICE_SID_FLD_VEC_PE:
-                       es = (struct ice_sw_fv_section *)sect;
+                       es = sect;
                        src = (u8 *)es->fv;
                        sect_len = (u32)(le16_to_cpu(es->count) *
                                         hw->blk[block_id].es.fvw) *
index c33612132ddf0a12fb9dd2b07b8be501367c912e..67c965a3f5d28a5da9ddf4e2a67e2d696b9711b3 100644 (file)
@@ -603,7 +603,7 @@ enum ice_status ice_get_initial_sw_cfg(struct ice_hw *hw)
                }
        } while (req_desc && !status);
 
-       devm_kfree(ice_hw_to_dev(hw), (void *)rbuf);
+       devm_kfree(ice_hw_to_dev(hw), rbuf);
        return status;
 }