On Sat, Feb 6, 2021 at 12:50 PM Sasha Levin <sashal@xxxxxxxxxx> wrote:
- ((c) > 255 ? 255 : (c)))'
+ ((c) > 255 ? 255 : (c)))'; \
+ echo \#define LINUX_VERSION_CODE2 $(shell \
+ expr $(VERSION) \* 16777216 + 0$(PATCHLEVEL) \* 65536 + 0$(SUBLEVEL)); \
Is this needed?
No one in this patch uses LINUX_VERSION_CODE2.
The in-kernel code can use
LINUX_VERSION_MAJOR/PATCHLEVEL/SUBLEVEL directly.
Userspace does not need LINUX_VERSION_CODE2 either.
Your comment in 2/3 states that
userspace only decodes MAJOR and PATCHLEVEL fields,
so LINUX_VERSION_CODE will still do well.
index ab4b98b3165db..a56bf381335e9 100644
--- a/tools/perf/tests/bpf-script-example.c
+++ b/tools/perf/tests/bpf-script-example.c
@@ -5,7 +5,7 @@
*/
#ifndef LINUX_VERSION_CODE
# error Need LINUX_VERSION_CODE
-# error Example: for 4.2 kernel, put 'clang-opt="-DLINUX_VERSION_CODE=0x40200" into llvm section of ~/.perfconfig'
+# error Example: for 4.2 kernel, put 'clang-opt="-DLINUX_VERSION_CODE=0x4020000" into llvm section of ~/.perfconfig'
Is this change needed?