Message ID | 20230203121553.2871598-1-arnd@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp808274wrn; Fri, 3 Feb 2023 04:24:28 -0800 (PST) X-Google-Smtp-Source: AK7set/HBxitzyXRHn3Lyj7hN4eBSTIKg/Gpk+O//aFq8DX05FIx1GybK4LufFr4vYoRKNYtQBhf X-Received: by 2002:a17:902:e3d5:b0:198:db5c:d2a0 with SMTP id r21-20020a170902e3d500b00198db5cd2a0mr1967726ple.35.1675427068099; Fri, 03 Feb 2023 04:24:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675427068; cv=none; d=google.com; s=arc-20160816; b=BTT6IkQT7d5Z7FmvAAttkNohEqGu7FWWnB1QpBjJn5szEEzSm7tj1dAQGADz0iVQGc crohhPvq0h8IpMw8/wvVtSDho2O2OcguekoCpnZkSf0m6g77puUY2Yqm9Btu2oDbvqGi DMwMSHRmbPRfkTtRENtAtwyBl+TG17+vZYZtJknUKuHalMD4yC/FzQC0us1hyikfnq66 CoK2Lxh5Eaz0if1RSOrCux2qbcjFr4pIj/mwfLy0RyfGTjMCu3Lbf3iyDEh4z4OQTf96 SA0Dbpl+1bQjCt/0XaNB0r86p3/7zu3dGxFLLhs5eDBfLxCoao1Sy10KNeN5YP8ZMA7h N2Sg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=N1N1CeC+N2gqJkLPqd/7CydhgVDM6CHTEZvcSVe9kj4=; b=eBuJrwYVV2Y2aLvY1b+hn9kvDQPlijq1kqwBtAQZYYwJu8sIQQxqC/VBRuxMv7HtsU ZGoESkJdKqSQLM2PA0LcYZHGwEElNbwBtOehUvJTDijdbVT+Q+IEM4ZHLmecr1u+hhS5 U16zwGKHrvEbUFUtaS68AerY8T0HO5dWwqbYy7btCpISe1GfQF2RLEbVA7hFnRH88CQP y3ICIllQpAlCCGZHQ3+Omjsw+lEOCvIOemnbOTS0xUNj1HmJkwCKYYpiLJOX5VTECscJ nCTPlaz5XtLt6MUV4pUZKv0MMSKTmmJ7cKoHKe9VundyFIavyIyIytcLQ+a5QB+7KTDE EHiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Yxz6PlT5; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x8-20020a170902ec8800b0018881a1c130si2317782plg.587.2023.02.03.04.24.15; Fri, 03 Feb 2023 04:24:28 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Yxz6PlT5; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232479AbjBCMQC (ORCPT <rfc822;il.mystafa@gmail.com> + 99 others); Fri, 3 Feb 2023 07:16:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58368 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231748AbjBCMQA (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 3 Feb 2023 07:16:00 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E78D265F1C; Fri, 3 Feb 2023 04:15:59 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 9E8DBB82A91; Fri, 3 Feb 2023 12:15:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D0F27C4339B; Fri, 3 Feb 2023 12:15:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1675426557; bh=bpsBfIP+WayDaYXAnzjXQUpZIfOqiX4IwY20qL1+qWI=; h=From:To:Cc:Subject:Date:From; b=Yxz6PlT5gTt/Whb6nIApqlbPy+k7RfxPTie1YnbROiauEnj/VS30emdyaNF/ih4jt QLyNMyB9tb8n8QqpS+FheiH5qXuO/zenEb3SycYoUktBzg1m7pgEbuH7ZfGvBZzMXk /rdNp7CJoplsXraaruvH0dDrjbICiuQqbQRMRiCx8VF+gdVb7RfsfrR161tdtrVjHF Gw/giAcmN0o4dHKcBrg0/CKGzNC4S4N+2+5CthXuY7yOEs0BVd0WWQZT88h9CSK7TF 0F5yp64pOnpbVsVLaZSzJYzxD2GxaO2ikxSbrAcxQgcdxsUx+l1lQ9TyrxHlUIQbDJ SBv7ikFxdOhpg== From: Arnd Bergmann <arnd@kernel.org> To: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>, "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, Raju Rangoju <Raju.Rangoju@amd.com> Cc: Arnd Bergmann <arnd@arndb.de>, Tom Lendacky <thomas.lendacky@amd.com>, Andrew Lunn <andrew@lunn.ch>, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] amd-xgbe: fix mismatched prototype Date: Fri, 3 Feb 2023 13:15:36 +0100 Message-Id: <20230203121553.2871598-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756812613384650574?= X-GMAIL-MSGID: =?utf-8?q?1756812613384650574?= |
Series |
amd-xgbe: fix mismatched prototype
|
|
Commit Message
Arnd Bergmann
Feb. 3, 2023, 12:15 p.m. UTC
From: Arnd Bergmann <arnd@arndb.de> The forward declaration was introduced with a prototype that does not match the function definition: drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c:2166:13: error: conflicting types for 'xgbe_phy_perform_ratechange' due to enum/integer mismatch; have 'void(struct xgbe_prv_data *, enum xgbe_mb_cmd, enum xgbe_mb_subcmd)' [-Werror=enum-int-mismatch] 2166 | static void xgbe_phy_perform_ratechange(struct xgbe_prv_data *pdata, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c:391:13: note: previous declaration of 'xgbe_phy_perform_ratechange' with type 'void(struct xgbe_prv_data *, unsigned int, unsigned int)' 391 | static void xgbe_phy_perform_ratechange(struct xgbe_prv_data *pdata, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ Ideally there should not be any forward declarations here, which would make it easier to show that there is no unbounded recursion. I tried fixing this but could not figure out how to avoid the recursive call. As a hotfix, address only the broken prototype to fix the build problem instead. Fixes: 4f3b20bfbb75 ("amd-xgbe: add support for rx-adaptation") Signed-off-by: Arnd Bergmann <arnd@arndb.de> --- drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
Comments
On Fri, Feb 03, 2023 at 01:15:36PM +0100, Arnd Bergmann wrote: > From: Arnd Bergmann <arnd@arndb.de> > > The forward declaration was introduced with a prototype that does > not match the function definition: > > drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c:2166:13: error: conflicting types for 'xgbe_phy_perform_ratechange' due to enum/integer mismatch; have 'void(struct xgbe_prv_data *, enum xgbe_mb_cmd, enum xgbe_mb_subcmd)' [-Werror=enum-int-mismatch] > 2166 | static void xgbe_phy_perform_ratechange(struct xgbe_prv_data *pdata, > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ > drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c:391:13: note: previous declaration of 'xgbe_phy_perform_ratechange' with type 'void(struct xgbe_prv_data *, unsigned int, unsigned int)' > 391 | static void xgbe_phy_perform_ratechange(struct xgbe_prv_data *pdata, > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ > > Ideally there should not be any forward declarations here, which > would make it easier to show that there is no unbounded recursion. > I tried fixing this but could not figure out how to avoid the > recursive call. > > As a hotfix, address only the broken prototype to fix the build > problem instead. > > Fixes: 4f3b20bfbb75 ("amd-xgbe: add support for rx-adaptation") > Signed-off-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Simon Horman <simon.horman@corigine.com>
On 2/3/2023 5:45 PM, Arnd Bergmann wrote: > From: Arnd Bergmann <arnd@arndb.de> > > The forward declaration was introduced with a prototype that does > not match the function definition: > > drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c:2166:13: error: conflicting types for 'xgbe_phy_perform_ratechange' due to enum/integer mismatch; have 'void(struct xgbe_prv_data *, enum xgbe_mb_cmd, enum xgbe_mb_subcmd)' [-Werror=enum-int-mismatch] > 2166 | static void xgbe_phy_perform_ratechange(struct xgbe_prv_data *pdata, > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ > drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c:391:13: note: previous declaration of 'xgbe_phy_perform_ratechange' with type 'void(struct xgbe_prv_data *, unsigned int, unsigned int)' > 391 | static void xgbe_phy_perform_ratechange(struct xgbe_prv_data *pdata, > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ > > Ideally there should not be any forward declarations here, which > would make it easier to show that there is no unbounded recursion. > I tried fixing this but could not figure out how to avoid the > recursive call. > > As a hotfix, address only the broken prototype to fix the build > problem instead. > > Fixes: 4f3b20bfbb75 ("amd-xgbe: add support for rx-adaptation") > Signed-off-by: Arnd Bergmann <arnd@arndb.de> Looks good to me. Acked-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com> Thanks, Shyam > --- > drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c b/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c > index 7d88caa4e623..16e7fb2c0dae 100644 > --- a/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c > +++ b/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c > @@ -390,7 +390,8 @@ static DEFINE_MUTEX(xgbe_phy_comm_lock); > static enum xgbe_an_mode xgbe_phy_an_mode(struct xgbe_prv_data *pdata); > static void xgbe_phy_rrc(struct xgbe_prv_data *pdata); > static void xgbe_phy_perform_ratechange(struct xgbe_prv_data *pdata, > - unsigned int cmd, unsigned int sub_cmd); > + enum xgbe_mb_cmd cmd, > + enum xgbe_mb_subcmd sub_cmd); > > static int xgbe_phy_i2c_xfer(struct xgbe_prv_data *pdata, > struct xgbe_i2c_op *i2c_op) >
On Fri, 3 Feb 2023 13:15:36 +0100 Arnd Bergmann wrote: > The forward declaration was introduced with a prototype that does > not match the function definition: > > drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c:2166:13: error: conflicting types for 'xgbe_phy_perform_ratechange' due to enum/integer mismatch; have 'void(struct xgbe_prv_data *, enum xgbe_mb_cmd, enum xgbe_mb_subcmd)' [-Werror=enum-int-mismatch] > 2166 | static void xgbe_phy_perform_ratechange(struct xgbe_prv_data *pdata, > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ > drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c:391:13: note: previous declaration of 'xgbe_phy_perform_ratechange' with type 'void(struct xgbe_prv_data *, unsigned int, unsigned int)' > 391 | static void xgbe_phy_perform_ratechange(struct xgbe_prv_data *pdata, > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ Thanks for the fix. What's the compiler / extra flags you're using? Doesn't pop up on our setups..
Hello: This patch was applied to netdev/net-next.git (master) by Jakub Kicinski <kuba@kernel.org>: On Fri, 3 Feb 2023 13:15:36 +0100 you wrote: > From: Arnd Bergmann <arnd@arndb.de> > > The forward declaration was introduced with a prototype that does > not match the function definition: > > drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c:2166:13: error: conflicting types for 'xgbe_phy_perform_ratechange' due to enum/integer mismatch; have 'void(struct xgbe_prv_data *, enum xgbe_mb_cmd, enum xgbe_mb_subcmd)' [-Werror=enum-int-mismatch] > 2166 | static void xgbe_phy_perform_ratechange(struct xgbe_prv_data *pdata, > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ > drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c:391:13: note: previous declaration of 'xgbe_phy_perform_ratechange' with type 'void(struct xgbe_prv_data *, unsigned int, unsigned int)' > 391 | static void xgbe_phy_perform_ratechange(struct xgbe_prv_data *pdata, > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ > > [...] Here is the summary with links: - amd-xgbe: fix mismatched prototype https://git.kernel.org/netdev/net-next/c/bbe641866318 You are awesome, thank you!
On 2/7/2023 11:58 AM, Jakub Kicinski wrote: > On Fri, 3 Feb 2023 13:15:36 +0100 Arnd Bergmann wrote: >> The forward declaration was introduced with a prototype that does >> not match the function definition: >> >> drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c:2166:13: error: conflicting types for 'xgbe_phy_perform_ratechange' due to enum/integer mismatch; have 'void(struct xgbe_prv_data *, enum xgbe_mb_cmd, enum xgbe_mb_subcmd)' [-Werror=enum-int-mismatch] >> 2166 | static void xgbe_phy_perform_ratechange(struct xgbe_prv_data *pdata, >> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ >> drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c:391:13: note: previous declaration of 'xgbe_phy_perform_ratechange' with type 'void(struct xgbe_prv_data *, unsigned int, unsigned int)' >> 391 | static void xgbe_phy_perform_ratechange(struct xgbe_prv_data *pdata, >> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ > > Thanks for the fix. What's the compiler / extra flags you're using? > Doesn't pop up on our setups.. > Yes please. Even this does not pop on our build systems too. Would like to know those extra compiler flags. Thanks, Shyam
On 2/7/2023 12:24 PM, Shyam Sundar S K wrote: > > > On 2/7/2023 11:58 AM, Jakub Kicinski wrote: >> On Fri, 3 Feb 2023 13:15:36 +0100 Arnd Bergmann wrote: >>> The forward declaration was introduced with a prototype that does >>> not match the function definition: >>> >>> drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c:2166:13: error: conflicting types for 'xgbe_phy_perform_ratechange' due to enum/integer mismatch; have 'void(struct xgbe_prv_data *, enum xgbe_mb_cmd, enum xgbe_mb_subcmd)' [-Werror=enum-int-mismatch] >>> 2166 | static void xgbe_phy_perform_ratechange(struct xgbe_prv_data *pdata, >>> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ >>> drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c:391:13: note: previous declaration of 'xgbe_phy_perform_ratechange' with type 'void(struct xgbe_prv_data *, unsigned int, unsigned int)' >>> 391 | static void xgbe_phy_perform_ratechange(struct xgbe_prv_data *pdata, >>> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ >> >> Thanks for the fix. What's the compiler / extra flags you're using? >> Doesn't pop up on our setups.. >> > > Yes please. Even this does not pop on our build systems too. Would like > to know those extra compiler flags. Hi Arnd, Gentle reminder! Please share the compiler details / additional flags used to reproduce this warning. Thanks, Raju > > Thanks, > Shyam
diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c b/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c index 7d88caa4e623..16e7fb2c0dae 100644 --- a/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c +++ b/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c @@ -390,7 +390,8 @@ static DEFINE_MUTEX(xgbe_phy_comm_lock); static enum xgbe_an_mode xgbe_phy_an_mode(struct xgbe_prv_data *pdata); static void xgbe_phy_rrc(struct xgbe_prv_data *pdata); static void xgbe_phy_perform_ratechange(struct xgbe_prv_data *pdata, - unsigned int cmd, unsigned int sub_cmd); + enum xgbe_mb_cmd cmd, + enum xgbe_mb_subcmd sub_cmd); static int xgbe_phy_i2c_xfer(struct xgbe_prv_data *pdata, struct xgbe_i2c_op *i2c_op)