Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1659169imu; Thu, 17 Jan 2019 00:54:13 -0800 (PST) X-Google-Smtp-Source: ALg8bN4Cv/4EPrOcTa8sehdMzuoAUDs6901H2CAzZgnwluX5yjek2bkTI62j83Hs+r1N/n4lt08z X-Received: by 2002:a63:a064:: with SMTP id u36mr12750732pgn.145.1547715252984; Thu, 17 Jan 2019 00:54:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547715252; cv=none; d=google.com; s=arc-20160816; b=gln24Zxwn68tD5rO9eq52FfZmxNzCnJxPoAlA7eUI4VUPxY4KHO6a+5vxT/xF4MfLD AgDhdqjxLoHFrgJUWnAxNrTm6seR21VOAhFIoiKKCWlLZhDyGwhSrIRekd5vRe1+oBup aIOiKCHHVhZmDAiyOLHCF9yAS2rtNt8LggP4ETafHANuWGBy96pui2xy9K5Q/XlTJ3Xi cifvZxIRdhNSLztXeUUl5AtaMg9QkNZgBAWGv4Zeh2LqWsHjx5TbPbYlLVB1U0cvW8mD rfUz8Lyita/YEELERnYHxGrKBvEgLGZNPr46hDclJK4ucqGF1pK/zvSl6gNjVNSDwPBo rA9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter; bh=foZhPygMSwpgwvy1W1X5gzceFVUJQ5+RKAbXMqBY8vU=; b=uyLe8+RD6jelkgJldMYL/AuQ9xqvDK2NlcAtCzWzMk688WAJO0aJ11sAghf/jx6/RB xyI3fibarHUEGEPG7kXrceaTCCN2aP3qs/h6O1ZivlbiJasVFOrX6yQRU01Gy4th0pEj jeONkSbQeRSkF7j5Pv652QE6wato4hFhIEWbhzVzjtjYoCVTS1CGg4gWkbiS2kJxXDsY yUsWM3ss40kx2ldp6JiiMP5WVnG5T+dczDCNzrz4oKRc23E8c6soQ7iQxz/fyBePBu4C MBVC73jYU0sKRGTAzgV82BB+sM9RA+LJAC+k1gRfsY2UOnOEUMKya30NcoRk7Vv+MskR 8oXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=ThLbu6Nl; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j6si1115316pfc.57.2019.01.17.00.53.57; Thu, 17 Jan 2019 00:54:12 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=ThLbu6Nl; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728611AbfAQELH (ORCPT + 99 others); Wed, 16 Jan 2019 23:11:07 -0500 Received: from conuserg-08.nifty.com ([210.131.2.75]:22828 "EHLO conuserg-08.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728531AbfAQELF (ORCPT ); Wed, 16 Jan 2019 23:11:05 -0500 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-08.nifty.com with ESMTP id x0H4AYQd007102; Thu, 17 Jan 2019 13:10:36 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-08.nifty.com x0H4AYQd007102 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1547698236; bh=foZhPygMSwpgwvy1W1X5gzceFVUJQ5+RKAbXMqBY8vU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ThLbu6Nlf/V9qCZH3gR9r+yQEarrI7G39j9DGLHu/8dTW0qYKxGe/zw8+ni39tdRl LtANIV5hewjy6k8rlOYYWaMI22QOdENkN1usg6R3Achs3nK6qXsITP8aiyQMV36EOx ah3G9aAib3Q+TvmCz8Jq+/jPOWIvmgjfbyBwvd93Iue4FK4mClIA1XQ1oC8zbDzPR5 xLOM7PP7pAnwRxn1CUVe6qooGoOSw5nI8MFgHuKgJaSuCQeoROdwz7uLHNCMJawCfF Pvj/c3caP9UGQOlO2EJ82HRSaGzJxEO+pt68/r9DbCF+ZGznbLn0OlWFgZkdOXwPG+ auVb1d84g3/gA== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org Subject: [PATCH 3/3] kbuild: remove unnecessary in-subshell execution Date: Thu, 17 Jan 2019 13:10:31 +0900 Message-Id: <1547698231-20985-3-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1547698231-20985-1-git-send-email-yamada.masahiro@socionext.com> References: <1547698231-20985-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The commands surrounded by ( ) are executed in a subshell, but in most cases, we do not need to spawn an extra subshell. Signed-off-by: Masahiro Yamada --- scripts/Makefile.build | 4 ++-- scripts/Makefile.lib | 21 ++++++++++----------- scripts/mkcompile_h | 4 ++-- 3 files changed, 14 insertions(+), 15 deletions(-) diff --git a/scripts/Makefile.build b/scripts/Makefile.build index 9800178..f8e2794 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build @@ -312,11 +312,11 @@ $(real-obj-m:.o=.s): modkern_aflags := $(KBUILD_AFLAGS_MODULE) $(AFLAGS_MODULE) # # These mirror gensymtypes_c and co above, keep them in synch. cmd_gensymtypes_S = \ - (echo "\#include " ; \ + { echo "\#include " ; \ echo "\#include " ; \ $(CPP) $(a_flags) $< | \ grep "\<___EXPORT_SYMBOL\>" | \ - sed 's/.*___EXPORT_SYMBOL[[:space:]]*\([a-zA-Z0-9_]*\)[[:space:]]*,.*/EXPORT_SYMBOL(\1);/' ) | \ + sed 's/.*___EXPORT_SYMBOL[[:space:]]*\([a-zA-Z0-9_]*\)[[:space:]]*,.*/EXPORT_SYMBOL(\1);/' ; } | \ $(CPP) -D__GENKSYMS__ $(c_flags) -xc - | \ $(GENKSYMS) $(if $(1), -T $(2)) \ $(patsubst y,-R,$(CONFIG_MODULE_REL_CRCS)) \ diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index c6fc295..c0abd9a 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -271,7 +271,7 @@ DTC_FLAGS += $(DTC_FLAGS_$(basetarget)) # Generate an assembly file to wrap the output of the device tree compiler quiet_cmd_dt_S_dtb= DTB $@ cmd_dt_S_dtb= \ -( \ +{ \ echo '\#include '; \ echo '.section .dtb.init.rodata,"a"'; \ echo '.balign STRUCT_ALIGNMENT'; \ @@ -281,7 +281,7 @@ cmd_dt_S_dtb= \ echo '__dtb_$(subst -,_,$(*F))_end:'; \ echo '.global __dtb_$(subst -,_,$(*F))_end'; \ echo '.balign STRUCT_ALIGNMENT'; \ -) > $@ +} > $@ $(obj)/%.dtb.S: $(obj)/%.dtb FORCE $(call if_changed,dt_S_dtb) @@ -335,20 +335,20 @@ printf "%08x\n" $$dec_size | \ ) quiet_cmd_bzip2 = BZIP2 $@ - cmd_bzip2 = (cat $(real-prereqs) | bzip2 -9 && $(size_append)) > $@ + cmd_bzip2 = { cat $(real-prereqs) | bzip2 -9 && $(size_append); } > $@ # Lzma # --------------------------------------------------------------------------- quiet_cmd_lzma = LZMA $@ - cmd_lzma = (cat $(real-prereqs) | lzma -9 && $(size_append)) > $@ + cmd_lzma = { cat $(real-prereqs) | lzma -9 && $(size_append); } > $@ quiet_cmd_lzo = LZO $@ - cmd_lzo = (cat $(real-prereqs) | lzop -9 && $(size_append)) > $@ + cmd_lzo = { cat $(real-prereqs) | lzop -9 && $(size_append); } > $@ quiet_cmd_lz4 = LZ4 $@ - cmd_lz4 = (cat $(real-prereqs) | lz4c -l -c1 stdin stdout && \ - $(size_append)) > $@ + cmd_lz4 = { cat $(real-prereqs) | lz4c -l -c1 stdin stdout && \ + $(size_append); } > $@ # U-Boot mkimage # --------------------------------------------------------------------------- @@ -390,12 +390,11 @@ quiet_cmd_uimage = UIMAGE $@ # big dictionary would increase the memory usage too much in the multi-call # decompression mode. A BCJ filter isn't used either. quiet_cmd_xzkern = XZKERN $@ - cmd_xzkern = (cat $(real-prereqs) | \ - sh $(srctree)/scripts/xz_wrap.sh && $(size_append)) > $@ + cmd_xzkern = { cat $(real-prereqs) | sh $(srctree)/scripts/xz_wrap.sh && \ + $(size_append); } > $@ quiet_cmd_xzmisc = XZMISC $@ - cmd_xzmisc = (cat $(real-prereqs) | \ - xz --check=crc32 --lzma2=dict=1MiB) > $@ + cmd_xzmisc = cat $(real-prereqs) | xz --check=crc32 --lzma2=dict=1MiB > $@ # ASM offsets # --------------------------------------------------------------------------- diff --git a/scripts/mkcompile_h b/scripts/mkcompile_h index 87f1fc9..2339f86 100755 --- a/scripts/mkcompile_h +++ b/scripts/mkcompile_h @@ -62,7 +62,7 @@ UTS_TRUNCATE="cut -b -$UTS_LEN" # Generate a temporary compile.h -( echo /\* This file is auto generated, version $VERSION \*/ +{ echo /\* This file is auto generated, version $VERSION \*/ if [ -n "$CONFIG_FLAGS" ] ; then echo "/* $CONFIG_FLAGS */"; fi echo \#define UTS_MACHINE \"$ARCH\" @@ -73,7 +73,7 @@ UTS_TRUNCATE="cut -b -$UTS_LEN" echo \#define LINUX_COMPILE_HOST \"`echo $LINUX_COMPILE_HOST | $UTS_TRUNCATE`\" echo \#define LINUX_COMPILER \"`$CC -v 2>&1 | grep ' version ' | sed 's/[[:space:]]*$//'`\" -) > .tmpcompile +} > .tmpcompile # Only replace the real compile.h if the new one is different, # in order to preserve the timestamp and avoid unnecessary -- 2.7.4