]> Pileus Git - ~andy/linux/commitdiff
kbuild: Fix <linux/version.h> for empty SUBLEVEL or PATCHLEVEL
authorMichal Marek <mmarek@suse.cz>
Mon, 30 May 2011 11:37:20 +0000 (13:37 +0200)
committerMichal Marek <mmarek@suse.cz>
Thu, 9 Jun 2011 21:05:54 +0000 (23:05 +0200)
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>
Makefile

index 4fe907510d796af36953828705875db8825bdd87..60d4a67626894960ef662bb866548d0db329de56 100644 (file)
--- 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