summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMasahiro Yamada <masahiroy@kernel.org>2021-12-14 11:53:55 +0900
committerMasahiro Yamada <masahiroy@kernel.org>2022-01-08 18:28:21 +0900
commitc0ee9bba55e1fda8ca22a2ac714d54737def50d4 (patch)
treecfeaf6935316aa3fc336c63df83c7fdd8f59dfb1
parent340a02535ee785c64c62a9c45706597a0139e972 (diff)
downloadlinux-stable-c0ee9bba55e1fda8ca22a2ac714d54737def50d4.tar.gz
linux-stable-c0ee9bba55e1fda8ca22a2ac714d54737def50d4.tar.bz2
linux-stable-c0ee9bba55e1fda8ca22a2ac714d54737def50d4.zip
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@kernel.org> Reviewed-by: Nicolas Schier <n.schier@avm.de>
-rw-r--r--arch/microblaze/Makefile6
1 files 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