Arnd Bergmann
2024-Mar-26 14:47 UTC
[PATCH 00/12] kbuild: enable some -Wextra warnings by default
From: Arnd Bergmann <arnd at arndb.de> This is a follow-up on a couple of patch series I sent in the past, enabling -Wextra (aside from stuff that is explicitly disabled), -Wcast-function-pointer-strict and -Wrestrict. I have tested these on 'defconfig' and 'allmodconfig' builds across all architectures, as well as many 'randconfig' builds on x86, arm and arm64. It would be nice to have all the Makefile.extrawarn changes in v6.10, hopefully with the driver fixes going in before that through the respective subsystem trees. Arnd Arnd Bergmann (12): kbuild: make -Woverride-init warnings more consistent [v3] parport: mfc3: avoid empty-body warning kbuild: turn on -Wextra by default kbuild: remove redundant extra warning flags firmware: dmi-id: add a release callback function nouveau: fix function cast warning cxlflash: fix function pointer cast warnings x86: math-emu: fix function cast warnings kbuild: enable -Wcast-function-type-strict unconditionally sata: sx4: fix pdc20621_get_from_dimm() on 64-bit [v4] kallsyms: rework symbol lookup return codes kbuild: turn on -Wrestrict by default arch/x86/math-emu/fpu_etc.c | 9 +++-- arch/x86/math-emu/fpu_trig.c | 6 ++-- arch/x86/math-emu/reg_constant.c | 7 +++- drivers/ata/sata_sx4.c | 6 ++-- drivers/firmware/dmi-id.c | 7 +++- .../gpu/drm/amd/display/dc/dce110/Makefile | 2 +- .../gpu/drm/amd/display/dc/dce112/Makefile | 2 +- .../gpu/drm/amd/display/dc/dce120/Makefile | 2 +- drivers/gpu/drm/amd/display/dc/dce60/Makefile | 2 +- drivers/gpu/drm/amd/display/dc/dce80/Makefile | 2 +- drivers/gpu/drm/i915/Makefile | 6 ++-- .../drm/nouveau/nvkm/subdev/bios/shadowof.c | 7 +++- drivers/gpu/drm/xe/Makefile | 4 +-- drivers/net/ethernet/renesas/sh_eth.c | 2 +- drivers/parport/parport_mfc3.c | 3 +- drivers/pinctrl/aspeed/Makefile | 2 +- drivers/scsi/cxlflash/lunmgt.c | 4 +-- drivers/scsi/cxlflash/main.c | 14 ++++---- drivers/scsi/cxlflash/superpipe.c | 34 +++++++++---------- drivers/scsi/cxlflash/superpipe.h | 11 +++--- drivers/scsi/cxlflash/vlun.c | 7 ++-- fs/proc/Makefile | 2 +- include/linux/filter.h | 14 ++++---- include/linux/ftrace.h | 6 ++-- include/linux/module.h | 14 ++++---- kernel/bpf/Makefile | 2 +- kernel/bpf/core.c | 7 ++-- kernel/kallsyms.c | 23 +++++++------ kernel/module/kallsyms.c | 26 +++++++------- kernel/trace/ftrace.c | 13 +++---- mm/Makefile | 3 +- scripts/Makefile.extrawarn | 33 ++++-------------- 32 files changed, 134 insertions(+), 148 deletions(-) -- 2.39.2 Cc: Bill Metzenthen <billm at melbpc.org.au> Cc: Thomas Gleixner <tglx at linutronix.de> Cc: x86 at kernel.org Cc: Damien Le Moal <dlemoal at kernel.org> Cc: Jean Delvare <jdelvare at suse.com> Cc: Harry Wentland <harry.wentland at amd.com> Cc: Jani Nikula <jani.nikula at linux.intel.com> Cc: Sergey Shtylyov <s.shtylyov at omp.ru> Cc: Jakub Kicinski <kuba at kernel.org> Cc: Sudip Mukherjee <sudipm.mukherjee at gmail.com> Cc: Andrew Jeffery <andrew at codeconstruct.com.au> Cc: "Manoj N. Kumar" <manoj at linux.ibm.com> Cc: "Martin K. Petersen" <martin.petersen at oracle.com> Cc: Alexei Starovoitov <ast at kernel.org> Cc: Steven Rostedt <rostedt at goodmis.org> Cc: Luis Chamberlain <mcgrof at kernel.org> Cc: Andrew Morton <akpm at linux-foundation.org> Cc: Masahiro Yamada <masahiroy at kernel.org> Cc: Nathan Chancellor <nathan at kernel.org> Cc: Nicolas Schier <nicolas at fjasle.eu> Cc: Greg Kroah-Hartman <gregkh at suse.de> Cc: linux-kernel at vger.kernel.org Cc: linux-ide at vger.kernel.org Cc: amd-gfx at lists.freedesktop.org Cc: dri-devel at lists.freedesktop.org Cc: intel-gfx at lists.freedesktop.org Cc: nouveau at lists.freedesktop.org Cc: intel-xe at lists.freedesktop.org Cc: netdev at vger.kernel.org Cc: linux-renesas-soc at vger.kernel.org Cc: linux-arm-kernel at lists.infradead.org Cc: linux-scsi at vger.kernel.org Cc: bpf at vger.kernel.org Cc: linux-trace-kernel at vger.kernel.org Cc: linux-modules at vger.kernel.org Cc: linux-mm at kvack.org Cc: linux-kbuild at vger.kernel.org Cc: llvm at lists.linux.dev
From: Arnd Bergmann <arnd at 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 at 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