From: Michal Marek <mmarek@suse.cz>
Date: Mon, 30 May 2011 11:37:20 +0000 (+0200)
Subject: kbuild: Fix <linux/version.h> for empty SUBLEVEL or PATCHLEVEL
X-Git-Tag: v3.0-rc3~18^2~3
X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=78d3bb4483ba;p=users%2Fjedix%2Flinux-maple.git

kbuild: Fix <linux/version.h> for empty SUBLEVEL or PATCHLEVEL

expr treats all numbers as decimals, so prepending a zero is safe. Note
that the KERNEL_VERSION() macro still takes three arguments, 3.0 has to be
written as KERNEL_VERSION(3,0,0).

Signed-off-by: Michal Marek <mmarek@suse.cz>
---

diff --git a/Makefile b/Makefile
index 4fe907510d79..60d4a6762689 100644
--- a/Makefile
+++ b/Makefile
@@ -1005,7 +1005,7 @@ endef
 
 define filechk_version.h
 	(echo \#define LINUX_VERSION_CODE $(shell                             \
-	expr $(VERSION) \* 65536 + $(PATCHLEVEL) \* 256 + $(SUBLEVEL));     \
+	expr $(VERSION) \* 65536 + 0$(PATCHLEVEL) \* 256 + 0$(SUBLEVEL));    \
 	echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))';)
 endef