[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <9d9fcdeb-4d0c-4371-b871-ad1fb8055033@redhat.com>
Date: Fri, 16 Feb 2024 19:27:29 +0100
From: Danilo Krummrich <dakr@...hat.com>
To: Arnd Bergmann <arnd@...nel.org>, Karol Herbst <kherbst@...hat.com>,
Lyude Paul <lyude@...hat.com>
Cc: Arnd Bergmann <arnd@...db.de>, David Airlie <airlied@...il.com>,
Daniel Vetter <daniel@...ll.ch>, Nathan Chancellor <nathan@...nel.org>,
Nick Desaulniers <ndesaulniers@...gle.com>, Bill Wendling
<morbo@...gle.com>, Justin Stitt <justinstitt@...gle.com>,
Ben Skeggs <bskeggs@...hat.com>, dri-devel@...ts.freedesktop.org,
nouveau@...ts.freedesktop.org, linux-kernel@...r.kernel.org,
llvm@...ts.linux.dev
Subject: Re: [PATCH] nouveau: fix function cast warnings
On 2/13/24 10:57, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@...db.de>
>
> clang-16 warns about casting between incompatible function types:
>
> drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c:161:10: error: cast from 'void (*)(const struct firmware *)' to 'void (*)(void *)' converts to incompatible function type [-Werror,-Wcast-function-type-strict]
> 161 | .fini = (void(*)(void *))release_firmware,
>
> This one was done to use the generic shadow_fw_release() function as a
> callback for struct nvbios_source. Change it to use the same prototype
> as the other five instances, with a trivial helper function that actually
> calls release_firmware.
>
> Fixes: 70c0f263cc2e ("drm/nouveau/bios: pull in basic vbios subdev, more to come later")
> Signed-off-by: Arnd Bergmann <arnd@...db.de>
Applied to drm-misc-fixes, thanks!
> ---
> drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c
> index 19188683c8fc..8c2bf1c16f2a 100644
> --- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c
> +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c
> @@ -154,11 +154,17 @@ shadow_fw_init(struct nvkm_bios *bios, const char *name)
> return (void *)fw;
> }
>
> +static void
> +shadow_fw_release(void *fw)
> +{
> + release_firmware(fw);
> +}
> +
> static const struct nvbios_source
> shadow_fw = {
> .name = "firmware",
> .init = shadow_fw_init,
> - .fini = (void(*)(void *))release_firmware,
> + .fini = shadow_fw_release,
> .read = shadow_fw_read,
> .rw = false,
> };
Powered by blists - more mailing lists