i40e: use assignment instead of memcpy
authorMitch Williams <mitch.a.williams@intel.com>
Wed, 18 Dec 2013 13:46:04 +0000 (13:46 +0000)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Sat, 11 Jan 2014 00:30:31 +0000 (16:30 -0800)
These instances were found by coccinelle/spatch, and can
use struct assignment instead of memcpy.

Change-ID: Idc23c3599241bf8a658bda18c80417af3fbfee66
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Sibai Li <sibai.li@intel.com>
Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/i40e/i40e_adminq.c
drivers/net/ethernet/intel/i40e/i40e_common.c
drivers/net/ethernet/intel/i40e/i40e_hmc.c

index c75aa2d07491a75d593582a6137ccc7bd96fdf2c..4e5a02cba289eab4af3f6669cc626b354f5cdd85 100644 (file)
@@ -922,7 +922,7 @@ i40e_status i40e_clean_arq_element(struct i40e_hw *hw,
                           "AQRX: Event received with error 0x%X.\n",
                           hw->aq.arq_last_status);
        } else {
-               memcpy(&e->desc, desc, sizeof(struct i40e_aq_desc));
+               e->desc = *desc;
                datalen = le16_to_cpu(desc->datalen);
                e->msg_size = min(datalen, e->msg_size);
                if (e->msg_buf != NULL && (e->msg_size != 0))
index 807312bb62a2d963a544f18f18884ff8f775b69e..6bfbeecd20626ff323540197e166d7262ca0dfb6 100644 (file)
@@ -599,8 +599,7 @@ i40e_status i40e_aq_get_link_info(struct i40e_hw *hw,
                goto aq_get_link_info_exit;
 
        /* save off old link status information */
-       memcpy(&hw->phy.link_info_old, hw_link_info,
-              sizeof(struct i40e_link_status));
+       hw->phy.link_info_old = *hw_link_info;
 
        /* update link status */
        hw_link_info->phy_type = (enum i40e_aq_phy_type)resp->phy_type;
index 76dfef3e0104ada4a7f2b4b062125108ada00267..bf2d4cc5b56927e87a1be2cd5772198533d27afa 100644 (file)
@@ -89,11 +89,9 @@ i40e_status i40e_add_sd_table_entry(struct i40e_hw *hw,
                        sd_entry->u.pd_table.pd_entry =
                                (struct i40e_hmc_pd_entry *)
                                sd_entry->u.pd_table.pd_entry_virt_mem.va;
-                       memcpy(&sd_entry->u.pd_table.pd_page_addr, &mem,
-                              sizeof(struct i40e_dma_mem));
+                       sd_entry->u.pd_table.pd_page_addr = mem;
                } else {
-                       memcpy(&sd_entry->u.bp.addr, &mem,
-                              sizeof(struct i40e_dma_mem));
+                       sd_entry->u.bp.addr = mem;
                        sd_entry->u.bp.sd_pd_index = sd_index;
                }
                /* initialize the sd entry */
@@ -164,7 +162,7 @@ i40e_status i40e_add_pd_table_entry(struct i40e_hw *hw,
                if (ret_code)
                        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.entry_type = I40E_SD_TYPE_PAGED;
                /* Set page address and valid bit */