kbuild: Fix <linux/version.h> for empty SUBLEVEL or PATCHLEVEL again
authorMasahiro Yamada <masahiroy@kernel.org>
Sat, 27 Feb 2021 14:20:23 +0000 (23:20 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Mar 2021 08:04:09 +0000 (09:04 +0100)
commitbb2e41e65c33a40502c9d876c7a337984d665a30
treeda010efffb85f81ee10e9be7599a95610cd57aaa
parent72714560fbc7c2fc79e4a5e79c4aa2fd2118c616
kbuild: Fix <linux/version.h> for empty SUBLEVEL or PATCHLEVEL again

commit 207da4c82ade9a6d59f7e794d737ba0748613fa2 upstream.

Commit 78d3bb4483ba ("kbuild: Fix <linux/version.h> for empty SUBLEVEL
or PATCHLEVEL") fixed the build error for empty SUBLEVEL or PATCHLEVEL
by prepending a zero.

Commit 9b82f13e7ef3 ("kbuild: clamp SUBLEVEL to 255") re-introduced
this issue.

This time, we cannot take the same approach because we have C code:

  #define LINUX_VERSION_PATCHLEVEL $(PATCHLEVEL)
  #define LINUX_VERSION_SUBLEVEL $(SUBLEVEL)

Replace empty SUBLEVEL/PATCHLEVEL with a zero.

Fixes: 9b82f13e7ef3 ("kbuild: clamp SUBLEVEL to 255")
Reported-by: Christian Zigotzky <chzigotzky@xenosoft.de>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-and-tested-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Makefile