summaryrefslogtreecommitdiffstats
path: root/init
diff options
context:
space:
mode:
authorMasahiro Yamada <masahiroy@kernel.org>2024-07-27 23:03:00 +0900
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-08-29 17:35:52 +0200
commit4d6ac2efa0c7c2d9e3f220d0af6bf8b81e3c5e3a (patch)
tree12b899efb9242617cd4eed6f16b0876929829bf9 /init
parent4f687213e2cbdb848838e5759c959c14317e9d3e (diff)
downloadlinux-stable-4d6ac2efa0c7c2d9e3f220d0af6bf8b81e3c5e3a.tar.gz
linux-stable-4d6ac2efa0c7c2d9e3f220d0af6bf8b81e3c5e3a.tar.bz2
linux-stable-4d6ac2efa0c7c2d9e3f220d0af6bf8b81e3c5e3a.zip
rust: fix the default format for CONFIG_{RUSTC,BINDGEN}_VERSION_TEXT
[ Upstream commit aacf93e87f0d808ef46e621aa56caea336b4433c ] Another oddity in these config entries is their default value can fall back to 'n', which is a value for bool or tristate symbols. The '|| echo n' is an incorrect workaround to avoid the syntax error. This is not a big deal, as the entry is hidden by 'depends on RUST' in situations where '$(RUSTC) --version' or '$(BINDGEN) --version' fails. Anyway, it looks odd. The default of a string type symbol should be a double-quoted string literal. Turn it into an empty string when the version command fails. Fixes: 2f7ab1267dc9 ("Kbuild: add Rust support") Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Link: https://lore.kernel.org/r/20240727140302.1806011-2-masahiroy@kernel.org [ Rebased on top of v6.11-rc1. - Miguel ] Signed-off-by: Miguel Ojeda <ojeda@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'init')
-rw-r--r--init/Kconfig4
1 files changed, 2 insertions, 2 deletions
diff --git a/init/Kconfig b/init/Kconfig
index 051cbb22968b..9684e5d2b81c 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -1906,7 +1906,7 @@ config RUST
config RUSTC_VERSION_TEXT
string
depends on RUST
- default $(shell,$(RUSTC) --version 2>/dev/null || echo n)
+ default "$(shell,$(RUSTC) --version 2>/dev/null)"
config BINDGEN_VERSION_TEXT
string
@@ -1914,7 +1914,7 @@ config BINDGEN_VERSION_TEXT
# The dummy parameter `workaround-for-0.69.0` is required to support 0.69.0
# (https://github.com/rust-lang/rust-bindgen/pull/2678). It can be removed when
# the minimum version is upgraded past that (0.69.1 already fixed the issue).
- default $(shell,$(BINDGEN) --version workaround-for-0.69.0 2>/dev/null || echo n)
+ default "$(shell,$(BINDGEN) --version workaround-for-0.69.0 2>/dev/null)"
#
# Place an empty function call at each tracepoint site. Can be