public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Guan Jing <guanjing6@huawei.com>
To: <davem@davemloft.net>
Cc: <saeedm@nvidia.com>, <leon@kernel.org>, <edumazet@google.com>,
	<kuba@kernel.org>, <pabeni@redhat.com>, <netdev@vger.kernel.org>,
	<linux-rdma@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	Guan Jing <guanjing6@huawei.com>
Subject: [PATCH -next] net/mlx5: Fix build error of multiple definition
Date: Fri, 20 May 2022 15:34:23 +0800	[thread overview]
Message-ID: <20220520073423.35556-1-guanjing6@huawei.com> (raw)

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(-)

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__ */
-- 
2.17.1


             reply	other threads:[~2022-05-20  7:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-20  7:34 Guan Jing [this message]
2022-05-20 22:12 ` [PATCH -next] net/mlx5: Fix build error of multiple definition Saeed Mahameed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220520073423.35556-1-guanjing6@huawei.com \
    --to=guanjing6@huawei.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=leon@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=saeedm@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox