[v2,02/11] net/nfp: remove the unneeded call of underlying API

Message ID 20231028065315.1937188-3-chaoyong.he@corigine.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers
Series Clean up NFP PMD |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Chaoyong He Oct. 28, 2023, 6:53 a.m. UTC
  Remove the unneeded call of underlying API in function
'nfp_net_pf_read_mac()`, because we already store the result of it in
data structure.

Also change the return type of this function to 'void' as there is no
abnormal exit logic.

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Peng Zhang <peng.zhang@corigine.com>
---
 drivers/net/nfp/nfp_ethdev.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
  

Patch

diff --git a/drivers/net/nfp/nfp_ethdev.c b/drivers/net/nfp/nfp_ethdev.c
index 76317925ec..0fed0ef72d 100644
--- a/drivers/net/nfp/nfp_ethdev.c
+++ b/drivers/net/nfp/nfp_ethdev.c
@@ -21,7 +21,7 @@ 
 #include "nfp_ipsec.h"
 #include "nfp_logs.h"
 
-static int
+static void
 nfp_net_pf_read_mac(struct nfp_app_fw_nic *app_fw_nic,
 		uint16_t port)
 {
@@ -31,13 +31,9 @@  nfp_net_pf_read_mac(struct nfp_app_fw_nic *app_fw_nic,
 	/* Grab a pointer to the correct physical port */
 	hw = app_fw_nic->ports[port];
 
-	nfp_eth_table = nfp_eth_read_ports(app_fw_nic->pf_dev->cpp);
+	nfp_eth_table = app_fw_nic->pf_dev->nfp_eth_table;
 
 	rte_ether_addr_copy(&nfp_eth_table->ports[port].mac_addr, &hw->super.mac_addr);
-
-	free(nfp_eth_table);
-
-	return 0;
 }
 
 static int