Re: [PATCH] module: remove MODULE_VERSION()

From: Sami Tolvanen

Date: Fri Mar 13 2026 - 13:28:59 EST


On Fri, Mar 13, 2026 at 04:46:06PM +0100, Greg Kroah-Hartman wrote:
> On Fri, Mar 13, 2026 at 03:20:42PM +0100, Greg Kroah-Hartman wrote:
> > 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.
> >
> > For now, just make this 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.
> >
> > Cc: Luis Chamberlain <mcgrof@xxxxxxxxxx>
> > Cc: Petr Pavlu <petr.pavlu@xxxxxxxx>
> > Cc: Daniel Gomez <da.gomez@xxxxxxxxxx>
> > Cc: Sami Tolvanen <samitolvanen@xxxxxxxxxx>
> > Cc: Aaron Tomlin <atomlin@xxxxxxxxxxx>
> > Cc: Shyam Saini <shyamsaini@xxxxxxxxxxxxxxxxxxx>
> > Cc: Kees Cook <kees@xxxxxxxxxx>
> > Cc: Thorsten Blum <thorsten.blum@xxxxxxxxx>
> > Cc: Christoph Hellwig <hch@xxxxxxxxxxxxx>
> > Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
> > ---
> > include/linux/module.h | 56 +++++++++---------------------------------
> > kernel/params.c | 30 ----------------------
> > 2 files changed, 11 insertions(+), 75 deletions(-)
>
>
> Sami just pointed out to me off-list that maybe I should also drop the
> srcversion stuff too. I'll gladly do that too, does anyone know if
> anyone even uses that anymore?

Looks like a lof of distributions enable MODULE_SRCVERSION_ALL, but
I'm not sure if they actually depend on the feature:

https://oracle.github.io/kconfigs/?config=UTS_RELEASE&config=MODULE_SRCVERSION_ALL

Sami