From patchwork Fri Feb 3 12:15:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 52471 Return-Path: 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 + 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 ); 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 To: Shyam Sundar S K , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Raju Rangoju Cc: Arnd Bergmann , Tom Lendacky , Andrew Lunn , 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 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: 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?= From: Arnd Bergmann 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 Reviewed-by: Simon Horman Acked-by: Shyam Sundar S K --- 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)