Skip to content

module: remove MODULE_VERSION() and srcversion

Greg Kroah-Hartman linux-kbuild linux-modules lkml sashiko-reviews 2 versions – In review

Get series with b4
b4 am [email protected] change-id 20260731-module_ver_remove-fd505b32b111

Versions newest first · linked by author and title

  1. v2 Latest2 patches 4 repliesIn review
  2. v11 patch 13 repliesSuperseded

Changes in v2 from the cover letter

- 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

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2module: remove MODULE_VERSION()Documentation/ABI/stable/sysfs-module arch/x86/tools/relocs.c drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c +4 more+12 -962 replies
2/2module: remove srcversion module attributeDocumentation/ABI/stable/sysfs-module drivers/block/drbd/drbd_buildtag.c include/linux/module.h +5 more+1 -802 replies

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchChristoph Hellwig
1/2R-b R-b
2/2R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/2] module: remove MODULE_VERSION() and srcversion

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.

---
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,

Signature · 1 line
Greg Kroah-Hartman <[email protected]>