[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20211214025355.1267796-12-masahiroy@kernel.org>
Date: Tue, 14 Dec 2021 11:53:55 +0900
From: Masahiro Yamada <masahiroy@...nel.org>
To: linux-kbuild@...r.kernel.org
Cc: linux-kernel@...r.kernel.org,
Michal Simek <michal.simek@...inx.com>,
linux-arch@...r.kernel.org, David Howells <dhowells@...hat.com>,
David Woodhouse <dwmw2@...radead.org>,
keyrings@...r.kernel.org, Richard Weinberger <richard@....at>,
Nicolas Schier <n.schier@....de>,
Masahiro Yamada <masahiroy@...nel.org>
Subject: [PATCH v2 11/11] microblaze: use built-in function to get CPU_{MAJOR,MINOR,REV}
Use built-in functions instead of shell commands to avoid forking
processes.
Signed-off-by: Masahiro Yamada <masahiroy@...nel.org>
Reviewed-by: Nicolas Schier <n.schier@....de>
---
(no changes since v1)
arch/microblaze/Makefile | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/microblaze/Makefile b/arch/microblaze/Makefile
index a25e76d89e86..1826d9ce4459 100644
--- a/arch/microblaze/Makefile
+++ b/arch/microblaze/Makefile
@@ -6,9 +6,9 @@ UTS_SYSNAME = -DUTS_SYSNAME=\"Linux\"
# What CPU version are we building for, and crack it open
# as major.minor.rev
CPU_VER := $(CONFIG_XILINX_MICROBLAZE0_HW_VER)
-CPU_MAJOR := $(shell echo $(CPU_VER) | cut -d '.' -f 1)
-CPU_MINOR := $(shell echo $(CPU_VER) | cut -d '.' -f 2)
-CPU_REV := $(shell echo $(CPU_VER) | cut -d '.' -f 3)
+CPU_MAJOR := $(word 1, $(subst ., , $(CPU_VER)))
+CPU_MINOR := $(word 2, $(subst ., , $(CPU_VER)))
+CPU_REV := $(word 3, $(subst ., , $(CPU_VER)))
export CPU_VER CPU_MAJOR CPU_MINOR CPU_REV
--
2.32.0
Powered by blists - more mailing lists