diff mbox series

[-next] net/mlx5: Fix build error of multiple definition

Message ID 20220520073423.35556-1-guanjing6@huawei.com (mailing list archive)
State Not Applicable
Headers show
Series [-next] net/mlx5: Fix build error of multiple definition | expand

Commit Message

Guan Jing May 20, 2022, 7:34 a.m. UTC
There are some errors like:

drivers/net/ethernet/mellanox/mlx5/core/lag/lag.o:
In function `mlx5_lag_mpesw_init':
lag.c:(.text+0xb70): multiple definition of `mlx5_lag_mpesw_init'
drivers/net/ethernet/mellanox/mlx5/core/lag/debugfs.o:debugfs.c:(.text+0x440):
first defined here
drivers/net/ethernet/mellanox/mlx5/core/lag/lag.o: In function `mlx5_lag_mpesw_cleanup':
lag.c:(.text+0xb80): multiple definition of `mlx5_lag_mpesw_cleanup'
drivers/net/ethernet/mellanox/mlx5/core/lag/debugfs.o:debugfs.c:(.text+0x450):
first defined here

So, add 'static inline' on the defineation of these functions.

Reported-by: Hulk Robot <hulkci@huawei.com>
Fixes: 94db33177819 ("net/mlx5: Support multiport eswitch mode")
Signed-off-by: Guan Jing <guanjing6@huawei.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/lag/mpesw.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Saeed Mahameed May 20, 2022, 10:12 p.m. UTC | #1
On 20 May 15:34, Guan Jing wrote:
>There are some errors like:
>
>drivers/net/ethernet/mellanox/mlx5/core/lag/lag.o:
>In function `mlx5_lag_mpesw_init':
>lag.c:(.text+0xb70): multiple definition of `mlx5_lag_mpesw_init'
>drivers/net/ethernet/mellanox/mlx5/core/lag/debugfs.o:debugfs.c:(.text+0x440):
>first defined here
>drivers/net/ethernet/mellanox/mlx5/core/lag/lag.o: In function `mlx5_lag_mpesw_cleanup':
>lag.c:(.text+0xb80): multiple definition of `mlx5_lag_mpesw_cleanup'
>drivers/net/ethernet/mellanox/mlx5/core/lag/debugfs.o:debugfs.c:(.text+0x450):
>first defined here
>
>So, add 'static inline' on the defineation of these functions.
Already fixed by:
commit d935053a62fa11d06c757c1725782e46e7e823db
Author: Jakub Kicinski <kuba@kernel.org>
Date:   Wed May 18 11:30:22 2022 -0700

     net/mlx5: fix multiple definitions of mlx5_lag_mpesw_init / mlx5_lag_mpesw_cleanup


Thanks.
diff mbox series

Patch

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lag/mpesw.h b/drivers/net/ethernet/mellanox/mlx5/core/lag/mpesw.h
index d39a02280e29..be4abcb8fcd5 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/lag/mpesw.h
+++ b/drivers/net/ethernet/mellanox/mlx5/core/lag/mpesw.h
@@ -19,8 +19,8 @@  bool mlx5_lag_mpesw_is_activated(struct mlx5_core_dev *dev);
 void mlx5_lag_mpesw_init(struct mlx5_lag *ldev);
 void mlx5_lag_mpesw_cleanup(struct mlx5_lag *ldev);
 #else
-void mlx5_lag_mpesw_init(struct mlx5_lag *ldev) {}
-void mlx5_lag_mpesw_cleanup(struct mlx5_lag *ldev) {}
+static inline void mlx5_lag_mpesw_init(struct mlx5_lag *ldev) {}
+static inline void mlx5_lag_mpesw_cleanup(struct mlx5_lag *ldev) {}
 #endif
 
 #endif /* __MLX5_LAG_MPESW_H__ */