Commit c36bd4a7 authored by Mitch Williams's avatar Mitch Williams Committed by Jeff Kirsher

i40e: use assignment instead of memcpy

These instances were found by coccinelle/spatch, and can
use struct assignment instead of memcpy.

Change-ID: Idc23c3599241bf8a658bda18c80417af3fbfee66
Signed-off-by: default avatarMitch Williams <mitch.a.williams@intel.com>
Signed-off-by: default avatarJesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: default avatarSibai Li <sibai.li@intel.com>
Tested-by: default avatarKavindya Deegala <kavindya.s.deegala@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent 11b57f90
...@@ -922,7 +922,7 @@ i40e_status i40e_clean_arq_element(struct i40e_hw *hw, ...@@ -922,7 +922,7 @@ i40e_status i40e_clean_arq_element(struct i40e_hw *hw,
"AQRX: Event received with error 0x%X.\n", "AQRX: Event received with error 0x%X.\n",
hw->aq.arq_last_status); hw->aq.arq_last_status);
} else { } else {
memcpy(&e->desc, desc, sizeof(struct i40e_aq_desc)); e->desc = *desc;
datalen = le16_to_cpu(desc->datalen); datalen = le16_to_cpu(desc->datalen);
e->msg_size = min(datalen, e->msg_size); e->msg_size = min(datalen, e->msg_size);
if (e->msg_buf != NULL && (e->msg_size != 0)) if (e->msg_buf != NULL && (e->msg_size != 0))
......
...@@ -599,8 +599,7 @@ i40e_status i40e_aq_get_link_info(struct i40e_hw *hw, ...@@ -599,8 +599,7 @@ i40e_status i40e_aq_get_link_info(struct i40e_hw *hw,
goto aq_get_link_info_exit; goto aq_get_link_info_exit;
/* save off old link status information */ /* save off old link status information */
memcpy(&hw->phy.link_info_old, hw_link_info, hw->phy.link_info_old = *hw_link_info;
sizeof(struct i40e_link_status));
/* update link status */ /* update link status */
hw_link_info->phy_type = (enum i40e_aq_phy_type)resp->phy_type; hw_link_info->phy_type = (enum i40e_aq_phy_type)resp->phy_type;
......
...@@ -89,11 +89,9 @@ i40e_status i40e_add_sd_table_entry(struct i40e_hw *hw, ...@@ -89,11 +89,9 @@ i40e_status i40e_add_sd_table_entry(struct i40e_hw *hw,
sd_entry->u.pd_table.pd_entry = sd_entry->u.pd_table.pd_entry =
(struct i40e_hmc_pd_entry *) (struct i40e_hmc_pd_entry *)
sd_entry->u.pd_table.pd_entry_virt_mem.va; sd_entry->u.pd_table.pd_entry_virt_mem.va;
memcpy(&sd_entry->u.pd_table.pd_page_addr, &mem, sd_entry->u.pd_table.pd_page_addr = mem;
sizeof(struct i40e_dma_mem));
} else { } else {
memcpy(&sd_entry->u.bp.addr, &mem, sd_entry->u.bp.addr = mem;
sizeof(struct i40e_dma_mem));
sd_entry->u.bp.sd_pd_index = sd_index; sd_entry->u.bp.sd_pd_index = sd_index;
} }
/* initialize the sd entry */ /* initialize the sd entry */
...@@ -164,7 +162,7 @@ i40e_status i40e_add_pd_table_entry(struct i40e_hw *hw, ...@@ -164,7 +162,7 @@ i40e_status i40e_add_pd_table_entry(struct i40e_hw *hw,
if (ret_code) if (ret_code)
goto exit; goto exit;
memcpy(&pd_entry->bp.addr, &mem, sizeof(struct i40e_dma_mem)); pd_entry->bp.addr = mem;
pd_entry->bp.sd_pd_index = pd_index; pd_entry->bp.sd_pd_index = pd_index;
pd_entry->bp.entry_type = I40E_SD_TYPE_PAGED; pd_entry->bp.entry_type = I40E_SD_TYPE_PAGED;
/* Set page address and valid bit */ /* Set page address and valid bit */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment