Bumping the version number on the first pull request after each merge
window was deemed inappropriate for an in-tree component. The version
number carries little meaningful information in the context of the Linux
kernel release model, where stable and distribution might all carry
slightly different patches (without any change to the batman-adv version).

Instead, expose a UTC_RELEASE-based string to consumers of the netlink
and ethtool interfaces.

The out-of-tree batman-adv package is unaffected by this change.

Link: https://lore.kernel.org/r/[email protected]
Link: https://lore.kernel.org/r/[email protected]
Link: 
https://lore.kernel.org/r/20210203163302.13e8a...@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com
Link: https://lore.kernel.org/r/YnfjtpuAaH+Zkf9S@unreal
Link: https://lore.kernel.org/r/Y9faTA0rNSXg%2FsLD@nanopsycho
Signed-off-by: Sven Eckelmann <[email protected]>
---
 .gitignore              | 2 ++
 Makefile                | 2 ++
 compat-sources/Makefile | 3 +++
 compat-sources/compat.c | 7 +++++++
 net/batman-adv/main.c   | 1 -
 net/batman-adv/main.h   | 9 +++++++++
 6 files changed, 23 insertions(+), 1 deletion(-)

diff --git a/.gitignore b/.gitignore
index fdacbf29..1fa30c6b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -8,6 +8,8 @@
 /compat-sources/**/*.o
 /modules.order
 /Module.symvers
+/..module-common.o.cmd
+/.module-common.o
 /net/batman-adv/batman-adv.ko
 /net/batman-adv/.batman-adv.ko.cmd
 /net/batman-adv/batman-adv.mod.c
diff --git a/Makefile b/Makefile
index ae3fd885..017165c6 100644
--- a/Makefile
+++ b/Makefile
@@ -39,6 +39,8 @@ NOSTDINC_FLAGS += \
        -include $(PWD)/compat.h \
        $(CFLAGS)
 
+include $(PWD)/compat-sources/Makefile
+
 ifneq ($(REVISION),)
 NOSTDINC_FLAGS += -DBATADV_SOURCE_VERSION=\"$(REVISION)\"
 endif
diff --git a/compat-sources/Makefile b/compat-sources/Makefile
new file mode 100644
index 00000000..daf80deb
--- /dev/null
+++ b/compat-sources/Makefile
@@ -0,0 +1,3 @@
+# SPDX-License-Identifier: GPL-2.0
+
+batman-adv-y += ../../compat-sources/compat.o
diff --git a/compat-sources/compat.c b/compat-sources/compat.c
new file mode 100644
index 00000000..4aa5fcb8
--- /dev/null
+++ b/compat-sources/compat.c
@@ -0,0 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0
+
+#include <linux/module.h>
+
+#include "../net/batman-adv/main.h"
+
+MODULE_VERSION(BATADV_SOURCE_VERSION);
diff --git a/net/batman-adv/main.c b/net/batman-adv/main.c
index 2baf8e2c..5d27175a 100644
--- a/net/batman-adv/main.c
+++ b/net/batman-adv/main.c
@@ -696,6 +696,5 @@ MODULE_LICENSE("GPL");
 
 MODULE_AUTHOR(BATADV_DRIVER_AUTHOR);
 MODULE_DESCRIPTION(BATADV_DRIVER_DESC);
-MODULE_VERSION(BATADV_SOURCE_VERSION);
 MODULE_ALIAS_RTNL_LINK("batadv");
 MODULE_ALIAS_GENL_FAMILY(BATADV_NL_NAME);
diff --git a/net/batman-adv/main.h b/net/batman-adv/main.h
index 465d26d8..7f722425 100644
--- a/net/batman-adv/main.h
+++ b/net/batman-adv/main.h
@@ -7,15 +7,24 @@
 #ifndef _NET_BATMAN_ADV_MAIN_H_
 #define _NET_BATMAN_ADV_MAIN_H_
 
+#include <generated/utsrelease.h>
+
 #define BATADV_DRIVER_AUTHOR "Marek Lindner <[email protected]>, " \
                             "Simon Wunderlich <[email protected]>"
 #define BATADV_DRIVER_DESC   "B.A.T.M.A.N. advanced"
 #define BATADV_DRIVER_DEVICE "batman-adv"
 
+#ifdef CONFIG_BATMAN_ADV_IN_TREE // UGLY_HACK_NEW
+#define BATADV_SOURCE_VERSION "linux-" UTS_RELEASE
+#else // UGLY_HACK_OLD
+
+/* prefer version provided by Makefile */
 #ifndef BATADV_SOURCE_VERSION
 #define BATADV_SOURCE_VERSION "2026.2"
 #endif
 
+#endif // UGLY_HACK_STOP
+
 /* B.A.T.M.A.N. parameters */
 
 #define BATADV_TQ_MAX_VALUE 255

---
base-commit: 7700c90cbd12d04b8aabb62fe031ce6b31d6a4d9
change-id: 20260515-no-upstream-version-bumps-ea213a18051a

Best regards,
--  
Sven Eckelmann <[email protected]>

Reply via email to