From 661256e63ed005ba9ee44a01506e853126b70b8b Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Sat, 20 Mar 2021 13:52:59 +0100 Subject: [PATCH] 5.10-stable patches added patches: kbuild-fix-linux-version.h-for-empty-sublevel-or-patchlevel-again.patch --- ...r-empty-sublevel-or-patchlevel-again.patch | 54 +++++++++++++++++++ queue-5.10/series | 1 + 2 files changed, 55 insertions(+) create mode 100644 queue-5.10/kbuild-fix-linux-version.h-for-empty-sublevel-or-patchlevel-again.patch diff --git a/queue-5.10/kbuild-fix-linux-version.h-for-empty-sublevel-or-patchlevel-again.patch b/queue-5.10/kbuild-fix-linux-version.h-for-empty-sublevel-or-patchlevel-again.patch new file mode 100644 index 00000000000..c4befd21f99 --- /dev/null +++ b/queue-5.10/kbuild-fix-linux-version.h-for-empty-sublevel-or-patchlevel-again.patch @@ -0,0 +1,54 @@ +From 207da4c82ade9a6d59f7e794d737ba0748613fa2 Mon Sep 17 00:00:00 2001 +From: Masahiro Yamada +Date: Sat, 27 Feb 2021 23:20:23 +0900 +Subject: kbuild: Fix for empty SUBLEVEL or PATCHLEVEL again + +From: Masahiro Yamada + +commit 207da4c82ade9a6d59f7e794d737ba0748613fa2 upstream. + +Commit 78d3bb4483ba ("kbuild: Fix for empty SUBLEVEL +or PATCHLEVEL") fixed the build error for empty SUBLEVEL or PATCHLEVEL +by prepending a zero. + +Commit 9b82f13e7ef3 ("kbuild: clamp SUBLEVEL to 255") re-introduced +this issue. + +This time, we cannot take the same approach because we have C code: + + #define LINUX_VERSION_PATCHLEVEL $(PATCHLEVEL) + #define LINUX_VERSION_SUBLEVEL $(SUBLEVEL) + +Replace empty SUBLEVEL/PATCHLEVEL with a zero. + +Fixes: 9b82f13e7ef3 ("kbuild: clamp SUBLEVEL to 255") +Reported-by: Christian Zigotzky +Signed-off-by: Masahiro Yamada +Reviewed-and-tested-by: Sasha Levin +Signed-off-by: Greg Kroah-Hartman +--- + Makefile | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +--- a/Makefile ++++ b/Makefile +@@ -1249,15 +1249,17 @@ endef + define filechk_version.h + if [ $(SUBLEVEL) -gt 255 ]; then \ + echo \#define LINUX_VERSION_CODE $(shell \ +- expr $(VERSION) \* 65536 + 0$(PATCHLEVEL) \* 256 + 255); \ ++ expr $(VERSION) \* 65536 + $(PATCHLEVEL) \* 256 + 255); \ + else \ + echo \#define LINUX_VERSION_CODE $(shell \ +- expr $(VERSION) \* 65536 + 0$(PATCHLEVEL) \* 256 + $(SUBLEVEL)); \ ++ expr $(VERSION) \* 65536 + $(PATCHLEVEL) \* 256 + $(SUBLEVEL)); \ + fi; \ + echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + \ + ((c) > 255 ? 255 : (c)))' + endef + ++$(version_h): PATCHLEVEL := $(if $(PATCHLEVEL), $(PATCHLEVEL), 0) ++$(version_h): SUBLEVEL := $(if $(SUBLEVEL), $(SUBLEVEL), 0) + $(version_h): FORCE + $(call filechk,version.h) + $(Q)rm -f $(old_version_h) diff --git a/queue-5.10/series b/queue-5.10/series index 7ed18040d47..6fdd571f69c 100644 --- a/queue-5.10/series +++ b/queue-5.10/series @@ -50,3 +50,4 @@ i915-perf-start-hrtimer-only-if-sampling-the-oa-buffer.patch pstore-fix-warning-in-pstore_kill_sb.patch io_uring-ensure-that-sqpoll-thread-is-started-for-exit.patch net-qrtr-fix-__netdev_alloc_skb-call.patch +kbuild-fix-linux-version.h-for-empty-sublevel-or-patchlevel-again.patch -- 2.47.3