Skip to content

Commit

Permalink
kbuild: Fix <linux/version.h> for empty SUBLEVEL or PATCHLEVEL
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
michal42 committed Jun 9, 2011
1 parent cacd54e commit 78d3bb4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 78d3bb4

Please sign in to comment.