Skip to content

Commit 185fdb4

Browse files
arndbdakr
authored andcommitted
nouveau: fix function cast warning
Calling a function through an incompatible pointer type causes breaks kcfi, so clang warns about the assignment: drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowof.c:73:10: error: cast from 'void (*)(const void *)' to 'void (*)(void *)' converts to incompatible function type [-Werror,-Wcast-function-type-strict] 73 | .fini = (void(*)(void *))kfree, Avoid this with a trivial wrapper. Fixes: c39f472 ("drm/nouveau: remove symlinks, move core/ to nvkm/ (no code changes)") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Danilo Krummrich <dakr@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240404160234.2923554-1-arnd@kernel.org
1 parent 838ae9f commit 185fdb4

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

  • drivers/gpu/drm/nouveau/nvkm/subdev/bios

drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowof.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,16 @@ of_init(struct nvkm_bios *bios, const char *name)
6666
return ERR_PTR(-EINVAL);
6767
}
6868

69+
static void of_fini(void *p)
70+
{
71+
kfree(p);
72+
}
73+
6974
const struct nvbios_source
7075
nvbios_of = {
7176
.name = "OpenFirmware",
7277
.init = of_init,
73-
.fini = (void(*)(void *))kfree,
78+
.fini = of_fini,
7479
.read = of_read,
7580
.size = of_size,
7681
.rw = false,

0 commit comments

Comments
 (0)