Skip to content

Commit 0affdba

Browse files
arndbdakr
authored andcommitted
nouveau: fix function cast warnings
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: 70c0f26 ("drm/nouveau/bios: pull in basic vbios subdev, more to come later") Signed-off-by: Arnd Bergmann <[email protected]> Signed-off-by: Danilo Krummrich <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 02f76a9 commit 0affdba

File tree

1 file changed

+7
-1
lines changed
  • drivers/gpu/drm/nouveau/nvkm/subdev/bios

1 file changed

+7
-1
lines changed

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,11 +154,17 @@ shadow_fw_init(struct nvkm_bios *bios, const char *name)
154154
return (void *)fw;
155155
}
156156

157+
static void
158+
shadow_fw_release(void *fw)
159+
{
160+
release_firmware(fw);
161+
}
162+
157163
static const struct nvbios_source
158164
shadow_fw = {
159165
.name = "firmware",
160166
.init = shadow_fw_init,
161-
.fini = (void(*)(void *))release_firmware,
167+
.fini = shadow_fw_release,
162168
.read = shadow_fw_read,
163169
.rw = false,
164170
};

0 commit comments

Comments
 (0)