From: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
To: Arnd Bergmann <arnd@kernel.org>,
"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: Re: [PATCH] amd-xgbe: fix mismatched prototype
Date: Mon, 6 Feb 2023 09:39:09 +0530 [thread overview]
Message-ID: <202b15a2-8aca-b183-23ee-8bf1d5ed2edb@amd.com> (raw)
In-Reply-To: <20230203121553.2871598-1-arnd@kernel.org>
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)
>
next prev parent reply other threads:[~2023-02-06 4:09 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-03 12:15 [PATCH] amd-xgbe: fix mismatched prototype Arnd Bergmann
2023-02-04 13:18 ` Simon Horman
2023-02-06 4:09 ` Shyam Sundar S K [this message]
2023-02-07 6:28 ` Jakub Kicinski
2023-02-07 6:54 ` Shyam Sundar S K
2023-02-16 3:25 ` Raju Rangoju
2023-02-07 6:40 ` patchwork-bot+netdevbpf
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=202b15a2-8aca-b183-23ee-8bf1d5ed2edb@amd.com \
--to=shyam-sundar.s-k@amd.com \
--cc=Raju.Rangoju@amd.com \
--cc=andrew@lunn.ch \
--cc=arnd@arndb.de \
--cc=arnd@kernel.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=thomas.lendacky@amd.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;
as well as URLs for NNTP newsgroup(s).