Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp2149572iob; Fri, 20 May 2022 03:13:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwpqlpY//aIz2Cwl6Pm+iPuopUbNNSrlD9Lui8h5hdWY5SGWtPm+4zKvZJI5Q/VEcuS9qA2 X-Received: by 2002:a17:907:3e25:b0:6fe:526a:a663 with SMTP id hp37-20020a1709073e2500b006fe526aa663mr8048168ejc.626.1653041637454; Fri, 20 May 2022 03:13:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653041637; cv=none; d=google.com; s=arc-20160816; b=pFomAZr2h4Ab1AE//k6VvvkMUjkJJc7cHyIIJWQpawpbwchRhsvevNQn9uGA8Wwiqv lE4eMwVm2jVn/tyI7RqEJUHH25nG/rFA/9xjTqn2qXRWgsVoT4wgfLWsXCOGFvpJ+Zqe 8ia36Zjq5HuftPRY3X3dwdvya8Nzissj8/CvWdSw+Trnkz+hYTwP+kSiezBwz51eIVGa OQU8hMx9i7aIADtwQzcEZahU9W1IRn6Hp7ndT4wfIH+xc7irwbD8MPFVHDUFTWbtpTCJ kwbuJFfPX/I1YueObMQ+SLJNljDPnwq1J+xFJP41o12HWCC+vFTbg0Pt0a4j4MnNzXGF C65w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=8xA6maf+cnfJSJh6xz3p9V7x9G828O9xubVnnKL0BNM=; b=dFMVB928wxzFdX0bzqG224cKNIoeOjdrALu3bh3t0IvSBDiWa3JjtiluBo439gW+Ej piv50tW9SZNnontZP9ZJ1rHqedihKYrJmARTLxvEaU4jxLTZe4dVYSdaV3G5Dn6jReHm Jx8ojkXcSA/9e9KnGIAz4dVQWkN2rmmP5Z9dq9WucUj71WUAg4GUq1SYIpH34jtj/dmS bnV2Q9JclzeTx4h89ogcy1qjWkt3OgSv5Dt3Rw4kmp2G+nszJ6vPUY8QvhllqSRQykNX W0cs1zbY/surDJBTM2aE31mYupRzQDIV+ucYHPdRwVILz4N58t2Onh4BsUpDsRgr7Rs5 aYpg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t2-20020aa7d4c2000000b0042acba0b85bsi7340480edr.200.2022.05.20.03.13.07; Fri, 20 May 2022 03:13:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346515AbiETHgO (ORCPT + 99 others); Fri, 20 May 2022 03:36:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46018 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238923AbiETHgM (ORCPT ); Fri, 20 May 2022 03:36:12 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D0601338A3; Fri, 20 May 2022 00:36:09 -0700 (PDT) Received: from kwepemi100015.china.huawei.com (unknown [172.30.72.55]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4L4JNl5R78zQkB3; Fri, 20 May 2022 15:33:11 +0800 (CST) Received: from kwepemm600012.china.huawei.com (7.193.23.74) by kwepemi100015.china.huawei.com (7.221.188.125) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Fri, 20 May 2022 15:36:07 +0800 Received: from ubuntu1804.huawei.com (10.67.175.29) by kwepemm600012.china.huawei.com (7.193.23.74) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Fri, 20 May 2022 15:36:01 +0800 From: Guan Jing To: CC: , , , , , , , , Guan Jing Subject: [PATCH -next] net/mlx5: Fix build error of multiple definition Date: Fri, 20 May 2022 15:34:23 +0800 Message-ID: <20220520073423.35556-1-guanjing6@huawei.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.67.175.29] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To kwepemm600012.china.huawei.com (7.193.23.74) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Fixes: 94db33177819 ("net/mlx5: Support multiport eswitch mode") Signed-off-by: Guan Jing --- 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