diff options
author | Sasha Levin <sashal@kernel.org> | 2021-02-12 17:29:24 +0100 |
---|---|---|
committer | Masahiro Yamada <masahiroy@kernel.org> | 2021-02-16 04:01:45 +0100 |
commit | 88a686728b3739d3598851e729c0e81f194e5c53 (patch) | |
tree | 4de7baef4769c087f14d7aef4f0b4803cd290706 /kernel/sys.c | |
parent | kbuild: clamp SUBLEVEL to 255 (diff) | |
download | linux-88a686728b3739d3598851e729c0e81f194e5c53.tar.xz linux-88a686728b3739d3598851e729c0e81f194e5c53.zip |
kbuild: simplify access to the kernel's version
Instead of storing the version in a single integer and having various
kernel (and userspace) code how it's constructed, export individual
(major, patchlevel, sublevel) components and simplify kernel code that
uses it.
This should also make it easier on userspace.
Signed-off-by: Sasha Levin <sashal@kernel.org>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Diffstat (limited to 'kernel/sys.c')
-rw-r--r-- | kernel/sys.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/sys.c b/kernel/sys.c index 51f00fe20e4d..c2225bd405d5 100644 --- a/kernel/sys.c +++ b/kernel/sys.c @@ -1243,7 +1243,7 @@ static int override_release(char __user *release, size_t len) break; rest++; } - v = ((LINUX_VERSION_CODE >> 8) & 0xff) + 60; + v = LINUX_VERSION_PATCHLEVEL + 60; copy = clamp_t(size_t, len, 1, sizeof(buf)); copy = scnprintf(buf, copy, "2.6.%u%s", v, rest); ret = copy_to_user(release, buf, copy + 1); |