Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1721297imu; Thu, 17 Jan 2019 02:05:42 -0800 (PST) X-Google-Smtp-Source: ALg8bN5HSCvIfTiXb4oaN2LX56SApWch7KEa8mwSkDo3FyhC4cY12967YD9iUsSUMM0SPReDV6ql X-Received: by 2002:a65:560e:: with SMTP id l14mr12876056pgs.168.1547719542250; Thu, 17 Jan 2019 02:05:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547719542; cv=none; d=google.com; s=arc-20160816; b=V7ypHm7A/9FqcCTxL2uupxoqd3OlxaigJdJ6bPt1NQH4XFMeSOq5d6FzRJBSjwWdss lADe7A1flUrfM3X7VUANwDtP6LbvihO1yGpsuop4ISlSdV/FCrdSW1NLseMkIjSigJhF YTlCLDRw4Ef099wAq9crtB49cnPaBCt1gEyzIo0b1H816udiW2z4lRau9yDhvf1kgaoD ZFy4hzHpdGqyqbMSIw3iAiF+qCrcnGpKZnQ7mbERr+0FNMf5ld9VxUizI2+nT9XygMlM gCtEyMBS3jN5uV6fTNO+a610yscdl4tiNkHxcGtTzL5/29Lxu4+5xn/K0NXkqDZ+JANn Bp3w== 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=soy1QAAm9zjbqbxh/eF8P8dx1NBX+Q5/ESX1favG7s8=; b=qBJ0keqKfIb+PiCrkjM3f5vvFyuhAmvx7Y8PgGZPnqvfnKR0H659Odj8DHWfdN87Xl EGWD0oSwCWgkMIYtv8fqj8A0vi0ZK/l0e6cD59ChkFrfX2HJk+DvKNPe6fgYojhUm4KO 6I3GqhN+xOY+G8+Y7Dolkjo1fhOQRGnJEKHGEwxH8GDek0gomoK6XAnR9FC1MDNslEOS HhfIDmR3nUOYt8gfOLMrb9696gjESWJY51SkE+EV5VB4pZX5agfQmjSwaCFU7HUF0iFS wrl3vOeggScUXQBQ54xUvnJJ5EENG6tn7dhjpuEe92+3KBHCTueNp6P/31PD2Y1xiVWv lx9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=mBWnQHCA; 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 y22si1350987pfa.6.2019.01.17.02.05.25; Thu, 17 Jan 2019 02:05:42 -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=mBWnQHCA; 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 S1727714AbfAQKDr (ORCPT + 99 others); Thu, 17 Jan 2019 05:03:47 -0500 Received: from conuserg-11.nifty.com ([210.131.2.78]:49394 "EHLO conuserg-11.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726985AbfAQKDg (ORCPT ); Thu, 17 Jan 2019 05:03:36 -0500 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-11.nifty.com with ESMTP id x0HA38Gt009525; Thu, 17 Jan 2019 19:03:11 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com x0HA38Gt009525 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1547719392; bh=soy1QAAm9zjbqbxh/eF8P8dx1NBX+Q5/ESX1favG7s8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mBWnQHCAno0hRXrIv1/BWp+TQ5HNg+bXOXxeN5tR6N3jv5qp1fAVoZBew1H5n6ozx QRQRI5blUfNFwwWK9rUq0marR1jhoMMPZu29xlFC64nSUWWwnjVTGP4TnFWAETPauN Z/vFjK58juF7ef9ZevE8/mgfD06WgbTgOykrRiCxJ8opuWY2F39HfEOsQALuSI9FDE bpATk77Z7TEoy64DlbXSQRTvU/yG6+nKC2iZMgdPw4+RhPTu7r6fqgxbHIF6Bu5MFV mT+jDJCcw1g+kr2krr1zc4XvK+O7vl4dbjUBx3hzzYASTRyv+Vc2a3tR5xsuqWyJ6I jApeHHrJRm3GA== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Martin Schwidefsky , linux-s390@vger.kernel.org, Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org Subject: [PATCH v2 4/4] kbuild: remove unnecessary in-subshell execution Date: Thu, 17 Jan 2019 19:02:44 +0900 Message-Id: <1547719364-18849-4-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1547719364-18849-1-git-send-email-yamada.masahiro@socionext.com> References: <1547719364-18849-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 --- Changes in v2: None 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