[PATCH v2 02/11] net/nfp: remove the unneeded call of underlying API
Chaoyong He
chaoyong.he at corigine.com
Sat Oct 28 08:53:06 CEST 2023
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 at corigine.com>
Reviewed-by: Peng Zhang <peng.zhang at corigine.com>
---
drivers/net/nfp/nfp_ethdev.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
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
--
2.39.1
More information about the dev
mailing list