patches.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next v2] net: netcp: ethss: Fix type of first parameter in hwtstamp stubs
@ 2025-11-10 20:55 Nathan Chancellor
  2025-11-12  2:00 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: Nathan Chancellor @ 2025-11-10 20:55 UTC (permalink / raw)
  To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni
  Cc: Nick Desaulniers, Bill Wendling, Justin Stitt, Vadim Fedorenko,
	Kory Maincent, netdev, llvm, patches, Nathan Chancellor

When building without CONFIG_TI_CPTS, there are a series of errors from
-Wincompatible-pointer-types:

  drivers/net/ethernet/ti/netcp_ethss.c:3831:27: error: initialization of 'int (*)(void *, struct kernel_hwtstamp_config *)' from incompatible pointer type 'int (*)(struct gbe_intf *, struct kernel_hwtstamp_config *)' [-Wincompatible-pointer-types]
   3831 |         .hwtstamp_get   = gbe_hwtstamp_get,
        |                           ^~~~~~~~~~~~~~~~
  drivers/net/ethernet/ti/netcp_ethss.c:3831:27: note: (near initialization for 'gbe_module.hwtstamp_get')
  drivers/net/ethernet/ti/netcp_ethss.c:2758:19: note: 'gbe_hwtstamp_get' declared here
   2758 | static inline int gbe_hwtstamp_get(struct gbe_intf *gbe_intf,
        |                   ^~~~~~~~~~~~~~~~
  drivers/net/ethernet/ti/netcp_ethss.c:3832:27: error: initialization of 'int (*)(void *, struct kernel_hwtstamp_config *, struct netlink_ext_ack *)' from incompatible pointer type 'int (*)(struct gbe_intf *, struct kernel_hwtstamp_config *, struct netlink_ext_ack *)' [-Wincompatible-pointer-types]
   3832 |         .hwtstamp_set   = gbe_hwtstamp_set,
        |                           ^~~~~~~~~~~~~~~~
  drivers/net/ethernet/ti/netcp_ethss.c:3832:27: note: (near initialization for 'gbe_module.hwtstamp_set')
  drivers/net/ethernet/ti/netcp_ethss.c:2764:19: note: 'gbe_hwtstamp_set' declared here
   2764 | static inline int gbe_hwtstamp_set(struct gbe_intf *gbe_intf,
        |                   ^~~~~~~~~~~~~~~~

In a recent conversion to ndo_hwtstamp, the type of the first parameter
was updated for the CONFIG_TI_CPTS=y implementations of
gbe_hwtstamp_get() and gbe_hwtstamp_set() but not the CONFIG_TI_CPTS=n
ones.

Update the type of the first parameter in the CONFIG_TI_CPTS=n stubs to
resolve the errors.

Fixes: 3f02b8272557 ("ti: netcp: convert to ndo_hwtstamp callbacks")
Reviewed-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
Changes in v2:
- Rewrite commit message, as this issue is visible with just
  -Wincompatible-pointer-types with both clang and GCC. I have an out of
  tree patch to build with -Wincompatible-function-pointer-types-strict
  locally applied, which actually changes the type of warning emitted in
  this case... https://godbolt.org/z/WGb1cYqod
- Carry forward Vadim's reviewed-by, as the code fix is unchanged.
- Link to v1: https://patch.msgid.link/20251107-netcp_ethss-fix-cpts-stubs-clang-wifpts-v1-1-a80a30c429a8@kernel.org
---
 drivers/net/ethernet/ti/netcp_ethss.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/ti/netcp_ethss.c b/drivers/net/ethernet/ti/netcp_ethss.c
index 0ae44112812c..4f6cc6cd1f03 100644
--- a/drivers/net/ethernet/ti/netcp_ethss.c
+++ b/drivers/net/ethernet/ti/netcp_ethss.c
@@ -2755,13 +2755,13 @@ static inline void gbe_unregister_cpts(struct gbe_priv *gbe_dev)
 {
 }
 
-static inline int gbe_hwtstamp_get(struct gbe_intf *gbe_intf,
+static inline int gbe_hwtstamp_get(void *intf_priv,
 				   struct kernel_hwtstamp_config *cfg)
 {
 	return -EOPNOTSUPP;
 }
 
-static inline int gbe_hwtstamp_set(struct gbe_intf *gbe_intf,
+static inline int gbe_hwtstamp_set(void *intf_priv,
 				   struct kernel_hwtstamp_config *cfg,
 				   struct netlink_ext_ack *extack)
 {

---
base-commit: 01c87d7f48b4f9b8be0950ed4de5d345632bd564
change-id: 20251107-netcp_ethss-fix-cpts-stubs-clang-wifpts-df78ff1d4a7b

Best regards,
--  
Nathan Chancellor <nathan@kernel.org>


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

* Re: [PATCH net-next v2] net: netcp: ethss: Fix type of first parameter in hwtstamp stubs
  2025-11-10 20:55 [PATCH net-next v2] net: netcp: ethss: Fix type of first parameter in hwtstamp stubs Nathan Chancellor
@ 2025-11-12  2:00 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-11-12  2:00 UTC (permalink / raw)
  To: Nathan Chancellor
  Cc: andrew+netdev, davem, edumazet, kuba, pabeni,
	nick.desaulniers+lkml, morbo, justinstitt, vadim.fedorenko,
	kory.maincent, netdev, llvm, patches

Hello:

This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Mon, 10 Nov 2025 13:55:34 -0700 you wrote:
> When building without CONFIG_TI_CPTS, there are a series of errors from
> -Wincompatible-pointer-types:
> 
>   drivers/net/ethernet/ti/netcp_ethss.c:3831:27: error: initialization of 'int (*)(void *, struct kernel_hwtstamp_config *)' from incompatible pointer type 'int (*)(struct gbe_intf *, struct kernel_hwtstamp_config *)' [-Wincompatible-pointer-types]
>    3831 |         .hwtstamp_get   = gbe_hwtstamp_get,
>         |                           ^~~~~~~~~~~~~~~~
>   drivers/net/ethernet/ti/netcp_ethss.c:3831:27: note: (near initialization for 'gbe_module.hwtstamp_get')
>   drivers/net/ethernet/ti/netcp_ethss.c:2758:19: note: 'gbe_hwtstamp_get' declared here
>    2758 | static inline int gbe_hwtstamp_get(struct gbe_intf *gbe_intf,
>         |                   ^~~~~~~~~~~~~~~~
>   drivers/net/ethernet/ti/netcp_ethss.c:3832:27: error: initialization of 'int (*)(void *, struct kernel_hwtstamp_config *, struct netlink_ext_ack *)' from incompatible pointer type 'int (*)(struct gbe_intf *, struct kernel_hwtstamp_config *, struct netlink_ext_ack *)' [-Wincompatible-pointer-types]
>    3832 |         .hwtstamp_set   = gbe_hwtstamp_set,
>         |                           ^~~~~~~~~~~~~~~~
>   drivers/net/ethernet/ti/netcp_ethss.c:3832:27: note: (near initialization for 'gbe_module.hwtstamp_set')
>   drivers/net/ethernet/ti/netcp_ethss.c:2764:19: note: 'gbe_hwtstamp_set' declared here
>    2764 | static inline int gbe_hwtstamp_set(struct gbe_intf *gbe_intf,
>         |                   ^~~~~~~~~~~~~~~~
> 
> [...]

Here is the summary with links:
  - [net-next,v2] net: netcp: ethss: Fix type of first parameter in hwtstamp stubs
    https://git.kernel.org/netdev/net-next/c/34bff6f03c13

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] 2+ messages in thread

end of thread, other threads:[~2025-11-12  2:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-10 20:55 [PATCH net-next v2] net: netcp: ethss: Fix type of first parameter in hwtstamp stubs Nathan Chancellor
2025-11-12  2:00 ` 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).