* [PATCH net-next] net: stmmac: dwmac-meson8b: Avoid cast to incompatible function type
@ 2023-04-18 11:07 Simon Horman
2023-04-18 18:36 ` Nick Desaulniers
2023-04-20 1:50 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Simon Horman @ 2023-04-18 11:07 UTC (permalink / raw)
To: Jakub Kicinski, David S. Miller, Eric Dumazet, Paolo Abeni
Cc: Giuseppe Cavallaro, Alexandre Torgue, Jose Abreu, Neil Armstrong,
Kevin Hilman, Jerome Brunet, Martin Blumenstingl, Maxime Coquelin,
Nathan Chancellor, Nick Desaulniers, Tom Rix, netdev,
linux-arm-kernel, linux-amlogic, linux-stm32, llvm
Rather than casting clk_disable_unprepare to an incompatible function
type provide a trivial wrapper with the correct signature for the
use-case.
Reported by clang-16 with W=1:
drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c:276:6: error: cast from 'void (*)(struct clk *)' to 'void (*)(void *)' converts to incompatible function type [-Werror,-Wcast-function-type-strict]
(void(*)(void *))clk_disable_unprepare,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
No functional change intended.
Compile tested only.
Signed-off-by: Simon Horman <horms@kernel.org>
---
drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c
index e8b507f88fbc..f6754e3643f3 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c
@@ -263,6 +263,11 @@ static int meson_axg_set_phy_mode(struct meson8b_dwmac *dwmac)
return 0;
}
+static void meson8b_clk_disable_unprepare(void *data)
+{
+ clk_disable_unprepare(data);
+}
+
static int meson8b_devm_clk_prepare_enable(struct meson8b_dwmac *dwmac,
struct clk *clk)
{
@@ -273,8 +278,7 @@ static int meson8b_devm_clk_prepare_enable(struct meson8b_dwmac *dwmac,
return ret;
return devm_add_action_or_reset(dwmac->dev,
- (void(*)(void *))clk_disable_unprepare,
- clk);
+ meson8b_clk_disable_unprepare, clk);
}
static int meson8b_init_rgmii_delays(struct meson8b_dwmac *dwmac)
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH net-next] net: stmmac: dwmac-meson8b: Avoid cast to incompatible function type
2023-04-18 11:07 [PATCH net-next] net: stmmac: dwmac-meson8b: Avoid cast to incompatible function type Simon Horman
@ 2023-04-18 18:36 ` Nick Desaulniers
2023-04-20 1:50 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Nick Desaulniers @ 2023-04-18 18:36 UTC (permalink / raw)
To: Simon Horman
Cc: Jakub Kicinski, David S. Miller, Eric Dumazet, Paolo Abeni,
Giuseppe Cavallaro, Alexandre Torgue, Jose Abreu, Neil Armstrong,
Kevin Hilman, Jerome Brunet, Martin Blumenstingl, Maxime Coquelin,
Nathan Chancellor, Tom Rix, netdev, linux-arm-kernel,
linux-amlogic, linux-stm32, llvm, Sami Tolvanen,
Nathan Huckleberry
On Tue, Apr 18, 2023 at 4:07 AM Simon Horman <horms@kernel.org> wrote:
>
> Rather than casting clk_disable_unprepare to an incompatible function
> type provide a trivial wrapper with the correct signature for the
> use-case.
>
> Reported by clang-16 with W=1:
>
> drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c:276:6: error: cast from 'void (*)(struct clk *)' to 'void (*)(void *)' converts to incompatible function type [-Werror,-Wcast-function-type-strict]
> (void(*)(void *))clk_disable_unprepare,
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> No functional change intended.
> Compile tested only.
>
> Signed-off-by: Simon Horman <horms@kernel.org>
Thanks for the patch!
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
> ---
> drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c
> index e8b507f88fbc..f6754e3643f3 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c
> @@ -263,6 +263,11 @@ static int meson_axg_set_phy_mode(struct meson8b_dwmac *dwmac)
> return 0;
> }
>
> +static void meson8b_clk_disable_unprepare(void *data)
> +{
> + clk_disable_unprepare(data);
> +}
> +
> static int meson8b_devm_clk_prepare_enable(struct meson8b_dwmac *dwmac,
> struct clk *clk)
> {
> @@ -273,8 +278,7 @@ static int meson8b_devm_clk_prepare_enable(struct meson8b_dwmac *dwmac,
> return ret;
>
> return devm_add_action_or_reset(dwmac->dev,
> - (void(*)(void *))clk_disable_unprepare,
> - clk);
> + meson8b_clk_disable_unprepare, clk);
> }
>
> static int meson8b_init_rgmii_delays(struct meson8b_dwmac *dwmac)
>
--
Thanks,
~Nick Desaulniers
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH net-next] net: stmmac: dwmac-meson8b: Avoid cast to incompatible function type
2023-04-18 11:07 [PATCH net-next] net: stmmac: dwmac-meson8b: Avoid cast to incompatible function type Simon Horman
2023-04-18 18:36 ` Nick Desaulniers
@ 2023-04-20 1:50 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-04-20 1:50 UTC (permalink / raw)
To: Simon Horman
Cc: kuba, davem, edumazet, pabeni, peppe.cavallaro, alexandre.torgue,
joabreu, neil.armstrong, khilman, jbrunet, martin.blumenstingl,
mcoquelin.stm32, nathan, ndesaulniers, trix, netdev,
linux-arm-kernel, linux-amlogic, linux-stm32, llvm
Hello:
This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Tue, 18 Apr 2023 13:07:33 +0200 you wrote:
> Rather than casting clk_disable_unprepare to an incompatible function
> type provide a trivial wrapper with the correct signature for the
> use-case.
>
> Reported by clang-16 with W=1:
>
> drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c:276:6: error: cast from 'void (*)(struct clk *)' to 'void (*)(void *)' converts to incompatible function type [-Werror,-Wcast-function-type-strict]
> (void(*)(void *))clk_disable_unprepare,
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> No functional change intended.
> Compile tested only.
>
> [...]
Here is the summary with links:
- [net-next] net: stmmac: dwmac-meson8b: Avoid cast to incompatible function type
https://git.kernel.org/netdev/net-next/c/43bb6100d8d5
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-04-20 1:51 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-18 11:07 [PATCH net-next] net: stmmac: dwmac-meson8b: Avoid cast to incompatible function type Simon Horman
2023-04-18 18:36 ` Nick Desaulniers
2023-04-20 1:50 ` 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).