i40e: Change some memcpys to struct assignments
Several memcpys are not necessary and can be changed to structure assignments. Struct assignments are always type safe so this is preferable. Change-ID: I7daf45a4b5e799c686b9d5c8ba9db047584ab82b Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com> Tested-by: Jim Young <james.m.young@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
This commit is contained in:
parent
25fc0e6590
commit
1a2f62489b
|
@ -1969,7 +1969,7 @@ void i40e_vlan_stripping_enable(struct i40e_vsi *vsi)
|
||||||
I40E_AQ_VSI_PVLAN_EMOD_STR_BOTH;
|
I40E_AQ_VSI_PVLAN_EMOD_STR_BOTH;
|
||||||
|
|
||||||
ctxt.seid = vsi->seid;
|
ctxt.seid = vsi->seid;
|
||||||
memcpy(&ctxt.info, &vsi->info, sizeof(vsi->info));
|
ctxt.info = vsi->info;
|
||||||
ret = i40e_aq_update_vsi_params(&vsi->back->hw, &ctxt, NULL);
|
ret = i40e_aq_update_vsi_params(&vsi->back->hw, &ctxt, NULL);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
dev_info(&vsi->back->pdev->dev,
|
dev_info(&vsi->back->pdev->dev,
|
||||||
|
@ -1998,7 +1998,7 @@ void i40e_vlan_stripping_disable(struct i40e_vsi *vsi)
|
||||||
I40E_AQ_VSI_PVLAN_EMOD_NOTHING;
|
I40E_AQ_VSI_PVLAN_EMOD_NOTHING;
|
||||||
|
|
||||||
ctxt.seid = vsi->seid;
|
ctxt.seid = vsi->seid;
|
||||||
memcpy(&ctxt.info, &vsi->info, sizeof(vsi->info));
|
ctxt.info = vsi->info;
|
||||||
ret = i40e_aq_update_vsi_params(&vsi->back->hw, &ctxt, NULL);
|
ret = i40e_aq_update_vsi_params(&vsi->back->hw, &ctxt, NULL);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
dev_info(&vsi->back->pdev->dev,
|
dev_info(&vsi->back->pdev->dev,
|
||||||
|
@ -2282,7 +2282,7 @@ int i40e_vsi_add_pvid(struct i40e_vsi *vsi, u16 vid)
|
||||||
I40E_AQ_VSI_PVLAN_EMOD_STR;
|
I40E_AQ_VSI_PVLAN_EMOD_STR;
|
||||||
|
|
||||||
ctxt.seid = vsi->seid;
|
ctxt.seid = vsi->seid;
|
||||||
memcpy(&ctxt.info, &vsi->info, sizeof(vsi->info));
|
ctxt.info = vsi->info;
|
||||||
aq_ret = i40e_aq_update_vsi_params(&vsi->back->hw, &ctxt, NULL);
|
aq_ret = i40e_aq_update_vsi_params(&vsi->back->hw, &ctxt, NULL);
|
||||||
if (aq_ret) {
|
if (aq_ret) {
|
||||||
dev_info(&vsi->back->pdev->dev,
|
dev_info(&vsi->back->pdev->dev,
|
||||||
|
@ -4395,7 +4395,7 @@ static int i40e_vsi_config_tc(struct i40e_vsi *vsi, u8 enabled_tc)
|
||||||
ctxt.pf_num = vsi->back->hw.pf_id;
|
ctxt.pf_num = vsi->back->hw.pf_id;
|
||||||
ctxt.vf_num = 0;
|
ctxt.vf_num = 0;
|
||||||
ctxt.uplink_seid = vsi->uplink_seid;
|
ctxt.uplink_seid = vsi->uplink_seid;
|
||||||
memcpy(&ctxt.info, &vsi->info, sizeof(vsi->info));
|
ctxt.info = vsi->info;
|
||||||
i40e_vsi_setup_queue_map(vsi, &ctxt, enabled_tc, false);
|
i40e_vsi_setup_queue_map(vsi, &ctxt, enabled_tc, false);
|
||||||
|
|
||||||
/* Update the VSI after updating the VSI queue-mapping information */
|
/* Update the VSI after updating the VSI queue-mapping information */
|
||||||
|
@ -5223,9 +5223,8 @@ static int i40e_handle_lldp_event(struct i40e_pf *pf,
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
memset(&tmp_dcbx_cfg, 0, sizeof(tmp_dcbx_cfg));
|
|
||||||
/* Store the old configuration */
|
/* Store the old configuration */
|
||||||
memcpy(&tmp_dcbx_cfg, &hw->local_dcbx_config, sizeof(tmp_dcbx_cfg));
|
tmp_dcbx_cfg = hw->local_dcbx_config;
|
||||||
|
|
||||||
/* Reset the old DCBx configuration data */
|
/* Reset the old DCBx configuration data */
|
||||||
memset(&hw->local_dcbx_config, 0, sizeof(hw->local_dcbx_config));
|
memset(&hw->local_dcbx_config, 0, sizeof(hw->local_dcbx_config));
|
||||||
|
@ -5785,11 +5784,9 @@ static void i40e_handle_link_event(struct i40e_pf *pf,
|
||||||
struct i40e_hw *hw = &pf->hw;
|
struct i40e_hw *hw = &pf->hw;
|
||||||
struct i40e_aqc_get_link_status *status =
|
struct i40e_aqc_get_link_status *status =
|
||||||
(struct i40e_aqc_get_link_status *)&e->desc.params.raw;
|
(struct i40e_aqc_get_link_status *)&e->desc.params.raw;
|
||||||
struct i40e_link_status *hw_link_info = &hw->phy.link_info;
|
|
||||||
|
|
||||||
/* save off old link status information */
|
/* save off old link status information */
|
||||||
memcpy(&pf->hw.phy.link_info_old, hw_link_info,
|
hw->phy.link_info_old = hw->phy.link_info;
|
||||||
sizeof(pf->hw.phy.link_info_old));
|
|
||||||
|
|
||||||
/* Do a new status request to re-enable LSE reporting
|
/* Do a new status request to re-enable LSE reporting
|
||||||
* and load new status information into the hw struct
|
* and load new status information into the hw struct
|
||||||
|
@ -8272,7 +8269,7 @@ static int i40e_add_vsi(struct i40e_vsi *vsi)
|
||||||
ret, pf->hw.aq.asq_last_status);
|
ret, pf->hw.aq.asq_last_status);
|
||||||
return -ENOENT;
|
return -ENOENT;
|
||||||
}
|
}
|
||||||
memcpy(&vsi->info, &ctxt.info, sizeof(ctxt.info));
|
vsi->info = ctxt.info;
|
||||||
vsi->info.valid_sections = 0;
|
vsi->info.valid_sections = 0;
|
||||||
|
|
||||||
vsi->seid = ctxt.seid;
|
vsi->seid = ctxt.seid;
|
||||||
|
@ -8406,7 +8403,7 @@ static int i40e_add_vsi(struct i40e_vsi *vsi)
|
||||||
ret = -ENOENT;
|
ret = -ENOENT;
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
memcpy(&vsi->info, &ctxt.info, sizeof(ctxt.info));
|
vsi->info = ctxt.info;
|
||||||
vsi->info.valid_sections = 0;
|
vsi->info.valid_sections = 0;
|
||||||
vsi->seid = ctxt.seid;
|
vsi->seid = ctxt.seid;
|
||||||
vsi->id = ctxt.vsi_number;
|
vsi->id = ctxt.vsi_number;
|
||||||
|
|
Loading…
Reference in New Issue