[PATCH v2] nvmem: meson-efuse: fix function pointer type mismatch

Arnd Bergmann arnd at arndb.de
Tue Feb 13 06:59:39 PST 2024


On Tue, Feb 13, 2024, at 15:28, Jerome Brunet wrote:
> clang-16 warns about casting functions to incompatible types, as is done
> here to call clk_disable_unprepare:
>
> drivers/nvmem/meson-efuse.c:78:12: error: cast from 'void (*)(struct 
> clk *)' to 'void (*)(void *)' converts to incompatible function type 
> [-Werror,-Wcast-function-type-strict]
>    78 |                                        (void(*)(void 
> *))clk_disable_unprepare,
>
> The pattern of getting, enabling and setting a disable callback for a
> clock can be replaced with devm_clk_get_enabled(), which also fixes
> this warning.
>
> Fixes: 611fbca1c861 ("nvmem: meson-efuse: add peripheral clock")
> Reported-by: Arnd Bergmann <arnd at arndb.de>
> Signed-off-by: Jerome Brunet <jbrunet at baylibre.com>

Perfect, much nicer than my version.

Acked-by: Arnd Bergmann <arnd at arndb.de>



More information about the linux-arm-kernel mailing list