netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] amd-xgbe: fix mismatched prototype
@ 2023-02-03 12:15 Arnd Bergmann
  2023-02-04 13:18 ` Simon Horman
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Arnd Bergmann @ 2023-02-03 12:15 UTC (permalink / raw)
  To: Shyam Sundar S K, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Raju Rangoju
  Cc: Arnd Bergmann, Tom Lendacky, Andrew Lunn, netdev, linux-kernel

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

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


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] amd-xgbe: fix mismatched prototype
  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
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: Simon Horman @ 2023-02-04 13:18 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Shyam Sundar S K, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Raju Rangoju, Arnd Bergmann, Tom Lendacky,
	Andrew Lunn, netdev, linux-kernel

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>


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] amd-xgbe: fix mismatched prototype
  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
  2023-02-07  6:28 ` Jakub Kicinski
  2023-02-07  6:40 ` patchwork-bot+netdevbpf
  3 siblings, 0 replies; 7+ messages in thread
From: Shyam Sundar S K @ 2023-02-06  4:09 UTC (permalink / raw)
  To: Arnd Bergmann, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Raju Rangoju
  Cc: Arnd Bergmann, Tom Lendacky, Andrew Lunn, netdev, linux-kernel



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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] amd-xgbe: fix mismatched prototype
  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
@ 2023-02-07  6:28 ` Jakub Kicinski
  2023-02-07  6:54   ` Shyam Sundar S K
  2023-02-07  6:40 ` patchwork-bot+netdevbpf
  3 siblings, 1 reply; 7+ messages in thread
From: Jakub Kicinski @ 2023-02-07  6:28 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Shyam Sundar S K, David S. Miller, Eric Dumazet, Paolo Abeni,
	Raju Rangoju, Arnd Bergmann, Tom Lendacky, Andrew Lunn, netdev,
	linux-kernel

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..

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] amd-xgbe: fix mismatched prototype
  2023-02-03 12:15 [PATCH] amd-xgbe: fix mismatched prototype Arnd Bergmann
                   ` (2 preceding siblings ...)
  2023-02-07  6:28 ` Jakub Kicinski
@ 2023-02-07  6:40 ` patchwork-bot+netdevbpf
  3 siblings, 0 replies; 7+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-02-07  6:40 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Shyam-sundar.S-k, davem, edumazet, kuba, pabeni, Raju.Rangoju,
	arnd, thomas.lendacky, andrew, netdev, linux-kernel

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!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] amd-xgbe: fix mismatched prototype
  2023-02-07  6:28 ` Jakub Kicinski
@ 2023-02-07  6:54   ` Shyam Sundar S K
  2023-02-16  3:25     ` Raju Rangoju
  0 siblings, 1 reply; 7+ messages in thread
From: Shyam Sundar S K @ 2023-02-07  6:54 UTC (permalink / raw)
  To: Jakub Kicinski, Arnd Bergmann
  Cc: David S. Miller, Eric Dumazet, Paolo Abeni, Raju Rangoju,
	Arnd Bergmann, Tom Lendacky, Andrew Lunn, netdev, linux-kernel



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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] amd-xgbe: fix mismatched prototype
  2023-02-07  6:54   ` Shyam Sundar S K
@ 2023-02-16  3:25     ` Raju Rangoju
  0 siblings, 0 replies; 7+ messages in thread
From: Raju Rangoju @ 2023-02-16  3:25 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Shyam Sundar S K, Jakub Kicinski, David S. Miller, Eric Dumazet,
	Paolo Abeni, Arnd Bergmann, Tom Lendacky, Andrew Lunn, netdev,
	linux-kernel



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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-02-16  3:25 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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

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