Skip to content

Commit 43bb610

Browse files
hormskuba-moo
authored andcommitted
net: stmmac: dwmac-meson8b: Avoid cast to incompatible function type
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> Reviewed-by: Nick Desaulniers <ndesaulniers@google.com> Link: https://lore.kernel.org/r/20230418-dwmac-meson8b-clk-cb-cast-v1-1-e892b670cbbb@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 91daa4f commit 43bb610

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,11 @@ static int meson_axg_set_phy_mode(struct meson8b_dwmac *dwmac)
263263
return 0;
264264
}
265265

266+
static void meson8b_clk_disable_unprepare(void *data)
267+
{
268+
clk_disable_unprepare(data);
269+
}
270+
266271
static int meson8b_devm_clk_prepare_enable(struct meson8b_dwmac *dwmac,
267272
struct clk *clk)
268273
{
@@ -273,8 +278,7 @@ static int meson8b_devm_clk_prepare_enable(struct meson8b_dwmac *dwmac,
273278
return ret;
274279

275280
return devm_add_action_or_reset(dwmac->dev,
276-
(void(*)(void *))clk_disable_unprepare,
277-
clk);
281+
meson8b_clk_disable_unprepare, clk);
278282
}
279283

280284
static int meson8b_init_rgmii_delays(struct meson8b_dwmac *dwmac)

0 commit comments

Comments
 (0)