mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-27 00:51:35 +00:00
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>
This commit is contained in:
parent
9b82f13e7e
commit
88a686728b
6 changed files with 13 additions and 10 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue