[dpdk-dev] [PATCH 20.05 02/15] net/mlx5: replace destructor syntax with common macro

Thomas Monjalon thomas at monjalon.net
Mon Feb 10 17:20:19 CET 2020


There is a macro RTE_FINI for destructors,
which is now used where appropriate for consistency.

The destructor function mlx5_pmd_socket_uninit does not need
to be declared separately in mlx5.h.

Signed-off-by: Thomas Monjalon <thomas at monjalon.net>
---
 drivers/net/mlx5/mlx5.h        | 1 -
 drivers/net/mlx5/mlx5_socket.c | 3 +--
 2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h
index d7c519bae0..2affcd2ba3 100644
--- a/drivers/net/mlx5/mlx5.h
+++ b/drivers/net/mlx5/mlx5.h
@@ -764,7 +764,6 @@ void mlx5_mp_uninit_secondary(void);
 /* mlx5_socket.c */
 
 int mlx5_pmd_socket_init(void);
-void mlx5_pmd_socket_uninit(void);
 
 /* mlx5_flow_meter.c */
 
diff --git a/drivers/net/mlx5/mlx5_socket.c b/drivers/net/mlx5/mlx5_socket.c
index cf2b433c00..a79896cb33 100644
--- a/drivers/net/mlx5/mlx5_socket.c
+++ b/drivers/net/mlx5/mlx5_socket.c
@@ -218,8 +218,7 @@ mlx5_pmd_socket_init(void)
 /**
  * Un-Initialize the pmd socket
  */
-void __attribute__((destructor))
-mlx5_pmd_socket_uninit(void)
+RTE_FINI(mlx5_pmd_socket_uninit)
 {
 	if (!server_socket)
 		return;
-- 
2.25.0



More information about the dev mailing list