Skip to content

Commit b58f2f7

Browse files
JoePerchesJeff Kirsher
authored andcommitted
i40e/i40evf: Remove addressof casts to same type
Using addressof then casting to the original type is pointless, so remove these unnecessary casts. Done via coccinelle script: $ cat typecast.cocci @@ type T; T foo; @@ - (T *)&foo + &foo Signed-off-by: Joe Perches <joe@perches.com> Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
1 parent e3e3bfd commit b58f2f7

2 files changed

Lines changed: 3 additions & 4 deletions

File tree

‎drivers/net/ethernet/intel/i40e/i40e_common.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1775,9 +1775,9 @@ static void i40e_parse_discover_capabilities(struct i40e_hw *hw, void *buff,
17751775
cap = (struct i40e_aqc_list_capabilities_element_resp *) buff;
17761776

17771777
if (list_type_opc == i40e_aqc_opc_list_dev_capabilities)
1778-
p = (struct i40e_hw_capabilities *)&hw->dev_caps;
1778+
p = &hw->dev_caps;
17791779
else if (list_type_opc == i40e_aqc_opc_list_func_capabilities)
1780-
p = (struct i40e_hw_capabilities *)&hw->func_caps;
1780+
p = &hw->func_caps;
17811781
else
17821782
return;
17831783

‎drivers/net/ethernet/intel/i40evf/i40e_common.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -565,8 +565,7 @@ i40e_status i40e_aq_send_msg_to_pf(struct i40e_hw *hw,
565565
details.async = true;
566566
cmd_details = &details;
567567
}
568-
status = i40evf_asq_send_command(hw, (struct i40e_aq_desc *)&desc, msg,
569-
msglen, cmd_details);
568+
status = i40evf_asq_send_command(hw, &desc, msg, msglen, cmd_details);
570569
return status;
571570
}
572571

0 commit comments

Comments
 (0)