Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+3 -3
+3 -3
arch/microblaze/Makefile
··· 6 6 # What CPU version are we building for, and crack it open 7 7 # as major.minor.rev 8 8 CPU_VER := $(CONFIG_XILINX_MICROBLAZE0_HW_VER) 9 - CPU_MAJOR := $(shell echo $(CPU_VER) | cut -d '.' -f 1) 10 - CPU_MINOR := $(shell echo $(CPU_VER) | cut -d '.' -f 2) 11 - CPU_REV := $(shell echo $(CPU_VER) | cut -d '.' -f 3) 9 + CPU_MAJOR := $(word 1, $(subst ., , $(CPU_VER))) 10 + CPU_MINOR := $(word 2, $(subst ., , $(CPU_VER))) 11 + CPU_REV := $(word 3, $(subst ., , $(CPU_VER))) 12 12 13 13 export CPU_VER CPU_MAJOR CPU_MINOR CPU_REV 14 14