[PATCH v2 0/2] module: remove MODULE_VERSION() and srcversion
From: Greg Kroah-Hartman
Date: Fri Jul 31 2026 - 09:11:59 EST
Module "versions" do not make sense as the kernel is built all at once,
the "version" is the overall kernel version number, so modules can not
really be described as having a unique version given that they rely on
the infrastructure of the whole kernel.
So remove the version and the srcversion fields as there is no need for
them anymore.
Note, for now, MODULE_VERSION() is just an "empty" define, to keep
existing code building properly as the tree is slowly purged of the use
of this over time. This macro will be removed entirely in the future
when there are no in-tree users.
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
Changes in v2:
- remove version from struct module and the sysfs file
- amd driver THIS_MODULE->version logic removal as it's pointless.
- add second patch in series to remove srcversion
- Link to v1: https://lore.kernel.org/r/2026031341-evolve-repeater-987b@gregkh
---
Greg Kroah-Hartman (2):
module: remove MODULE_VERSION()
module: remove srcversion module attribute
Documentation/ABI/stable/sysfs-module | 12 -------
arch/x86/tools/relocs.c | 1 -
drivers/block/drbd/drbd_buildtag.c | 7 +---
drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c | 7 +---
include/asm-generic/vmlinux.lds.h | 5 ---
include/linux/module.h | 58 ++++++--------------------------
kernel/module/Kconfig | 11 ------
kernel/module/main.c | 32 ------------------
kernel/params.c | 30 -----------------
scripts/Makefile.modpost | 1 -
scripts/mod/modpost.c | 24 -------------
scripts/mod/modpost.h | 1 -
12 files changed, 13 insertions(+), 176 deletions(-)
---
base-commit: 8ba098e6b6ff0db8edf28528d1552be261af30d4
change-id: 20260731-module_ver_remove-fd505b32b111
Best regards,
--
Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>