Skip to content

Commit 78d3bb4

Browse files
committed
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>
1 parent cacd54e commit 78d3bb4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1005,7 +1005,7 @@ endef
10051005

10061006
define filechk_version.h
10071007
(echo \#define LINUX_VERSION_CODE $(shell \
1008-
expr $(VERSION) \* 65536 + $(PATCHLEVEL) \* 256 + $(SUBLEVEL)); \
1008+
expr $(VERSION) \* 65536 + 0$(PATCHLEVEL) \* 256 + 0$(SUBLEVEL)); \
10091009
echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))';)
10101010
endef
10111011

0 commit comments

Comments
 (0)