From: Arnd Bergmann <arnd@kernel.org>
To: linux-kbuild@vger.kernel.org,
Masahiro Yamada <masahiroy@kernel.org>,
Karol Herbst <kherbst@redhat.com>, Lyude Paul <lyude@redhat.com>,
Danilo Krummrich <dakr@redhat.com>,
David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>,
Nathan Chancellor <nathan@kernel.org>,
Ben Skeggs <bskeggs@redhat.com>
Cc: Nicolas Schier <nicolas@fjasle.eu>, Arnd Bergmann <arnd@arndb.de>,
Nick Desaulniers <ndesaulniers@google.com>,
Bill Wendling <morbo@google.com>,
Justin Stitt <justinstitt@google.com>,
dri-devel@lists.freedesktop.org, nouveau@lists.freedesktop.org,
linux-kernel@vger.kernel.org, llvm@lists.linux.dev
Subject: [PATCH 06/12] nouveau: fix function cast warning
Date: Tue, 26 Mar 2024 15:51:31 +0100 [thread overview]
Message-ID: <20240326145140.3257163-5-arnd@kernel.org> (raw)
In-Reply-To: <20240326144741.3094687-1-arnd@kernel.org>
From: Arnd Bergmann <arnd@arndb.de>
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: c39f472e9f14 ("drm/nouveau: remove symlinks, move core/ to nvkm/ (no code changes)")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowof.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowof.c b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowof.c
index 4bf486b57101..0dbcc23305f3 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowof.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowof.c
@@ -66,11 +66,16 @@ of_init(struct nvkm_bios *bios, const char *name)
return ERR_PTR(-EINVAL);
}
+static void of_fini(void *p)
+{
+ return kfree(p);
+}
+
const struct nvbios_source
nvbios_of = {
.name = "OpenFirmware",
.init = of_init,
- .fini = (void(*)(void *))kfree,
+ .fini = of_fini,
.read = of_read,
.size = of_size,
.rw = false,
--
2.39.2
next prev parent reply other threads:[~2024-03-26 14:52 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-26 14:47 [PATCH 00/12] kbuild: enable some -Wextra warnings by default Arnd Bergmann
2024-03-26 14:47 ` [PATCH 01/12] kbuild: make -Woverride-init warnings more consistent Arnd Bergmann
2024-03-26 16:04 ` Hamza Mahfooz
2024-03-26 20:24 ` Jani Nikula
2024-03-26 20:55 ` Arnd Bergmann
2024-03-27 7:50 ` Jani Nikula
2024-03-27 9:22 ` Arnd Bergmann
2024-03-31 2:33 ` Masahiro Yamada
2024-03-31 2:33 ` Masahiro Yamada
2024-03-26 23:02 ` Andrew Jeffery
2024-03-28 9:18 ` Linus Walleij
2024-03-26 14:51 ` [PATCH 02/12] [v3] parport: mfc3: avoid empty-body warning Arnd Bergmann
2024-03-26 14:51 ` [PATCH 03/12] kbuild: turn on -Wextra by default Arnd Bergmann
2024-03-26 14:51 ` [PATCH 04/12] kbuild: remove redundant extra warning flags Arnd Bergmann
2024-03-26 14:51 ` [PATCH 05/12] firmware: dmi-id: add a release callback function Arnd Bergmann
2024-03-29 12:49 ` Jean Delvare
2024-03-29 16:12 ` Nathan Chancellor
2024-04-04 14:07 ` Arnd Bergmann
2024-04-08 7:59 ` Jean Delvare
2024-04-12 9:42 ` Arnd Bergmann
2024-04-13 20:38 ` Jean Delvare
2024-04-14 22:18 ` Stephen Rothwell
2024-03-26 14:51 ` Arnd Bergmann [this message]
2024-03-26 15:20 ` [PATCH 06/12] nouveau: fix function cast warning Timur Tabi
2024-03-26 16:02 ` Arnd Bergmann
2024-03-26 14:51 ` [PATCH 07/12] cxlflash: fix function pointer cast warnings Arnd Bergmann
2024-03-26 14:51 ` [PATCH 08/12] x86: math-emu: fix function " Arnd Bergmann
2024-03-26 14:51 ` [PATCH 09/12] kbuild: enable -Wcast-function-type-strict unconditionally Arnd Bergmann
2024-03-26 14:53 ` [PATCH 10/12] sata: sx4: fix pdc20621_get_from_dimm() on 64-bit Arnd Bergmann
2024-03-27 1:36 ` Damien Le Moal
2024-03-27 20:21 ` Arnd Bergmann
2024-03-28 0:14 ` Damien Le Moal
2024-03-26 14:53 ` [PATCH 11/12] [v4] kallsyms: rework symbol lookup return codes Arnd Bergmann
2024-03-26 17:06 ` Steven Rostedt
2024-03-26 17:10 ` Arnd Bergmann
2024-03-26 14:53 ` [PATCH 12/12] kbuild: turn on -Wrestrict by default Arnd Bergmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240326145140.3257163-5-arnd@kernel.org \
--to=arnd@kernel.org \
--cc=airlied@gmail.com \
--cc=arnd@arndb.de \
--cc=bskeggs@redhat.com \
--cc=dakr@redhat.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=justinstitt@google.com \
--cc=kherbst@redhat.com \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=lyude@redhat.com \
--cc=masahiroy@kernel.org \
--cc=morbo@google.com \
--cc=nathan@kernel.org \
--cc=ndesaulniers@google.com \
--cc=nicolas@fjasle.eu \
--cc=nouveau@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox