lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <19dc040e-e023-4a17-a6bb-8aca156088d0@linaro.org>
Date: Tue, 13 Feb 2024 11:27:06 +0100
From: Neil Armstrong <neil.armstrong@...aro.org>
To: Arnd Bergmann <arnd@...nel.org>,
 Srinivas Kandagatla <srinivas.kandagatla@...aro.org>
Cc: Arnd Bergmann <arnd@...db.de>, Kevin Hilman <khilman@...libre.com>,
 Jerome Brunet <jbrunet@...libre.com>,
 Martin Blumenstingl <martin.blumenstingl@...glemail.com>,
 Nathan Chancellor <nathan@...nel.org>,
 Nick Desaulniers <ndesaulniers@...gle.com>, Bill Wendling
 <morbo@...gle.com>, Justin Stitt <justinstitt@...gle.com>,
 Jernej Skrabec <jernej.skrabec@...il.com>,
 linux-arm-kernel@...ts.infradead.org, linux-amlogic@...ts.infradead.org,
 linux-kernel@...r.kernel.org, llvm@...ts.linux.dev
Subject: Re: [PATCH] nvmem: meson-efuse: fix function pointer type mismatch

On 13/02/2024 11:15, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@...db.de>
> 
> 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,
> 
> Address this with a trivial helper function that adjusts the return code.
> 
> Fixes: 611fbca1c861 ("nvmem: meson-efuse: add peripheral clock")
> Signed-off-by: Arnd Bergmann <arnd@...db.de>
> ---
>   drivers/nvmem/meson-efuse.c | 9 ++++++---
>   1 file changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/nvmem/meson-efuse.c b/drivers/nvmem/meson-efuse.c
> index b922df99f9bc..3b9e31d7d073 100644
> --- a/drivers/nvmem/meson-efuse.c
> +++ b/drivers/nvmem/meson-efuse.c
> @@ -38,6 +38,11 @@ static const struct of_device_id meson_efuse_match[] = {
>   };
>   MODULE_DEVICE_TABLE(of, meson_efuse_match);
>   
> +static void meson_efuse_clk_disable(void *clk)
> +{
> +	clk_disable_unprepare(clk);
> +}
> +
>   static int meson_efuse_probe(struct platform_device *pdev)
>   {
>   	struct device *dev = &pdev->dev;
> @@ -74,9 +79,7 @@ static int meson_efuse_probe(struct platform_device *pdev)
>   		return ret;
>   	}
>   
> -	ret = devm_add_action_or_reset(dev,
> -				       (void(*)(void *))clk_disable_unprepare,
> -				       clk);
> +	ret = devm_add_action_or_reset(dev, meson_efuse_clk_disable, clk);
>   	if (ret) {
>   		dev_err(dev, "failed to add disable callback");
>   		return ret;

Reviewed-by: Neil Armstrong <neil.armstrong@...aro.org>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ