All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] kbuild: give SUBLEVEL more room in KERNEL_VERSION
@ 2021-01-18  1:49 Sasha Levin
  2021-01-18  9:21 ` Greg KH
  0 siblings, 1 reply; 11+ messages in thread
From: Sasha Levin @ 2021-01-18  1:49 UTC (permalink / raw)
  To: masahiroy, michal.lkml, torvalds
  Cc: linux-kbuild, linux-kernel, gregkh, Sasha Levin, stable

SUBLEVEL only has 8 bits of space, which means that we'll overflow it
once it reaches 256.

Few of the stable branches will imminently overflow SUBLEVEL while
there's no risk of overflowing VERSION.

Thus, give SUBLEVEL 8 more bits which will be stolen from VERSION, this
should create a better balance between the different version numbers we
use.

The downside here is that Linus will have 8 bits less to play with, but
given our current release cadence (~10 weeks), the number of Linus's
fingers & toes (20), and the current VERSION (5) we can calculate that
VERSION will overflow in just over 1,000 years, so I'm kicking this can
down the road.

Cc: stable@kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index 9e73f82e0d863..dc2bad7a440d8 100644
--- a/Makefile
+++ b/Makefile
@@ -1252,8 +1252,8 @@ endef
 
 define filechk_version.h
 	echo \#define LINUX_VERSION_CODE $(shell                         \
-	expr $(VERSION) \* 65536 + 0$(PATCHLEVEL) \* 256 + 0$(SUBLEVEL)); \
-	echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))'
+	expr $(VERSION) \* 16777216 + 0$(PATCHLEVEL) \* 65536 + 0$(SUBLEVEL)); \
+	echo '#define KERNEL_VERSION(a,b,c) (((a) << 24) + ((b) << 16) + (c))'
 endef
 
 $(version_h): FORCE
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2021-01-18 22:56 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-18  1:49 [PATCH] kbuild: give SUBLEVEL more room in KERNEL_VERSION Sasha Levin
2021-01-18  9:21 ` Greg KH
2021-01-18  9:24   ` Greg KH
2021-01-18 13:39     ` Sasha Levin
2021-01-18 13:52       ` Greg KH
2021-01-18 15:31         ` Sasha Levin
2021-01-18 16:39           ` Greg KH
2021-01-18 10:27   ` Masahiro Yamada
2021-01-18 10:32     ` Greg KH
2021-01-18 22:54     ` David Laight
2021-01-18 13:38   ` Sasha Levin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.