VisionFive2 Linux kernel

StarFive Tech Linux Kernel for VisionFive (JH7110) boards (mirror)

More than 9999 Commits   32 Branches   54 Tags
author: Masahiro Yamada <masahiroy@kernel.org> 2021-02-27 23:20:23 +0900 committer: Masahiro Yamada <masahiroy@kernel.org> 2021-02-28 15:23:48 +0900 commit: 207da4c82ade9a6d59f7e794d737ba0748613fa2 parent: 2214945422c143f8bb27faed77a97f728c0a1cb1
Commit Summary:
kbuild: Fix <linux/version.h> for empty SUBLEVEL or PATCHLEVEL again
Diffstat:
1 file changed, 4 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 65355c933760..b0e1bb472202 100644
--- a/Makefile
+++ b/Makefile
@@ -1284,10 +1284,10 @@ 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)))';                                       \
@@ -1296,6 +1296,8 @@ define filechk_version.h
 	echo \#define LINUX_VERSION_SUBLEVEL $(SUBLEVEL)
 endef
 
+$(version_h): PATCHLEVEL := $(if $(PATCHLEVEL), $(PATCHLEVEL), 0)
+$(version_h): SUBLEVEL := $(if $(SUBLEVEL), $(SUBLEVEL), 0)
 $(version_h): FORCE
 	$(call filechk,version.h)