Commit d7595a22 authored by Jesse Brandeburg's avatar Jesse Brandeburg Committed by Jeff Kirsher

i40e: clean up coccicheck reported errors

coccicheck shows:

drivers/net/ethernet/intel/i40e/i40e_adminq.c:704:2-8: Replace memcpy
with struct assignment
drivers/net/ethernet/intel/i40e/i40e_adminq.c:763:1-7: Replace memcpy
with struct assignment
drivers/net/ethernet/intel/i40e/i40e_adminq.c:810:2-8: Replace memcpy
with struct assignment
drivers/net/ethernet/intel/i40e/i40e_common.c:510:2-8: Replace memcpy
with struct assignment

Fix each of them with a *a = *b;
Signed-off-by: default avatarJesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: default avatarKavindya Deegala <kavindya.s.deegala@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent 078b5876
...@@ -701,8 +701,7 @@ i40e_status i40e_asq_send_command(struct i40e_hw *hw, ...@@ -701,8 +701,7 @@ i40e_status i40e_asq_send_command(struct i40e_hw *hw,
details = I40E_ADMINQ_DETAILS(hw->aq.asq, hw->aq.asq.next_to_use); details = I40E_ADMINQ_DETAILS(hw->aq.asq, hw->aq.asq.next_to_use);
if (cmd_details) { if (cmd_details) {
memcpy(details, cmd_details, *details = *cmd_details;
sizeof(struct i40e_asq_cmd_details));
/* If the cmd_details are defined copy the cookie. The /* If the cmd_details are defined copy the cookie. The
* cpu_to_le32 is not needed here because the data is ignored * cpu_to_le32 is not needed here because the data is ignored
...@@ -760,7 +759,7 @@ i40e_status i40e_asq_send_command(struct i40e_hw *hw, ...@@ -760,7 +759,7 @@ i40e_status i40e_asq_send_command(struct i40e_hw *hw,
desc_on_ring = I40E_ADMINQ_DESC(hw->aq.asq, hw->aq.asq.next_to_use); desc_on_ring = I40E_ADMINQ_DESC(hw->aq.asq, hw->aq.asq.next_to_use);
/* if the desc is available copy the temp desc to the right place */ /* if the desc is available copy the temp desc to the right place */
memcpy(desc_on_ring, desc, sizeof(struct i40e_aq_desc)); *desc_on_ring = *desc;
/* if buff is not NULL assume indirect command */ /* if buff is not NULL assume indirect command */
if (buff != NULL) { if (buff != NULL) {
...@@ -807,7 +806,7 @@ i40e_status i40e_asq_send_command(struct i40e_hw *hw, ...@@ -807,7 +806,7 @@ i40e_status i40e_asq_send_command(struct i40e_hw *hw,
/* if ready, copy the desc back to temp */ /* if ready, copy the desc back to temp */
if (i40e_asq_done(hw)) { if (i40e_asq_done(hw)) {
memcpy(desc, desc_on_ring, sizeof(struct i40e_aq_desc)); *desc = *desc_on_ring;
if (buff != NULL) if (buff != NULL)
memcpy(buff, dma_buff->va, buff_size); memcpy(buff, dma_buff->va, buff_size);
retval = le16_to_cpu(desc->retval); retval = le16_to_cpu(desc->retval);
......
...@@ -507,7 +507,7 @@ i40e_status i40e_aq_get_link_info(struct i40e_hw *hw, ...@@ -507,7 +507,7 @@ i40e_status i40e_aq_get_link_info(struct i40e_hw *hw,
/* save link status information */ /* save link status information */
if (link) if (link)
memcpy(link, hw_link_info, sizeof(struct i40e_link_status)); *link = *hw_link_info;
/* flag cleared so helper functions don't call AQ again */ /* flag cleared so helper functions don't call AQ again */
hw->phy.get_link_info = false; hw->phy.get_link_info = false;
......
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