Skip to content

Commit

Permalink
microblaze: use built-in function to get CPU_{MAJOR,MINOR,REV}
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Masahiro Yamada committed Jan 8, 2022
1 parent 340a025 commit c0ee9bb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions arch/microblaze/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit c0ee9bb

Please sign in to comment.