From patchwork Thu Jan 3 01:32:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 154696 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp157150ljp; Wed, 2 Jan 2019 17:33:05 -0800 (PST) X-Google-Smtp-Source: ALg8bN5WklHs5E+VF6pFIguLtaph5dUWYBZbw1rvZ7NBwvOjPotavE78ofLgb3vd8kXfLjwZ4pDb X-Received: by 2002:a63:2784:: with SMTP id n126mr15688287pgn.48.1546479184931; Wed, 02 Jan 2019 17:33:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546479184; cv=none; d=google.com; s=arc-20160816; b=cIJIsCnEv5SsZYf4s21eP3zEhLfYN8K5qwOei1gnL2xJdLou3CmqR7x1xpInnsFAqR qz7WNSOEm6wSqHYydWXClmI8uSCSy7Y0HDbwNuQoPsc65GN1OX8AgmM32vz8j9xs67w1 V/WuOippRERhiN9tAmjdN6D17NJyOreKj1cxJXPCfVSAbcVFlQfYSJFAp3N6jA0ETAao YvA9cpviit7uqcHCosXT1uF5B0tY2DwERyiAME8JI4O2Pf31p3itGk6kkeQXhlqOeKQ4 qIRdOQPJQkSoS84kcolt1nqcowQirHpboI7rEqKhjSppF0yK1SG2APNP+fLCXExHLf5S r25A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:dkim-filter; bh=I9fjGBUiO+eOH5I5SOSB7cXRy50jjhhn8kKQaYD8uhQ=; b=GstUlZNYg/E9pcQpG7iwRSX4uzwfz0O+NLPtAQ0BINh2rOOfhyvzjdTHAcq/Dn6k+f Y9NhiSXv9JfW4k+AmZhqiqWlYBbKWOoIs9HBCKhJ0jMkHUTgwzMY+9JQNdIueMqNr191 VMlMRH0JocBe0o/3qvBQCvMEHI+XEMUG0B52U2uh0/T4G9n/942oUO1xagDWZ1Y/SqWs obSlOFBfX/gEt0bvB8Nozd1w/pjKUHIBKB6EmIT6KVBqST9Z97djtDnBQdl5xFbx6Ovx IYul1WP96/MwoWecKUu9bYDJ9Y1jUSzTQRhsAu/Js65PVExag1RLxiAFeIYy3pS6lyPQ Mvwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=gLA0fahL; 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 g26si4133325pfe.127.2019.01.02.17.33.04; Wed, 02 Jan 2019 17:33:04 -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=gLA0fahL; 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 S1727755AbfACBdD (ORCPT + 31 others); Wed, 2 Jan 2019 20:33:03 -0500 Received: from conuserg-08.nifty.com ([210.131.2.75]:54038 "EHLO conuserg-08.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726830AbfACBdD (ORCPT ); Wed, 2 Jan 2019 20:33:03 -0500 Received: from grover.tkatk1.zaq.ne.jp (zaqdadce369.zaq.ne.jp [218.220.227.105]) (authenticated) by conuserg-08.nifty.com with ESMTP id x031WiFN010645; Thu, 3 Jan 2019 10:32:44 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-08.nifty.com x031WiFN010645 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1546479164; bh=I9fjGBUiO+eOH5I5SOSB7cXRy50jjhhn8kKQaYD8uhQ=; h=From:To:Cc:Subject:Date:From; b=gLA0fahLvxbyFxzwRAcc9SfzNqXhoo6wLnk71jatgi3THfn99gwH9oa6AyS0/wPR4 PdpzesKnK4dnHK4MKb27FQ2wkjEiSeYD/57T4ycZUS38Gb495yt5bVMI1Q1ca9NHMS utwyEcUI7xDFjD3TiwItCOiaLHSUzXBgZ3RiGM5AhTYjSByjBr+NySNOc7jzk1cDkc LuPA32KCTvpY1umRm+LoHpm1sVrHx4JGaluw0qe5XaLsy4mKX9H1RutsiFn/jtY6HL DU2T2xQBSLdgcbxUv8whq2uYlGzfFERCTjNmuk9K+xV+ywInx4wjb5QY+0KLHAeRuY d/sxMXs/JXMLw== X-Nifty-SrcIP: [218.220.227.105] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org Subject: [PATCH v2] kbuild: remove unnecessary in-subshell execution Date: Thu, 3 Jan 2019 10:32:38 +0900 Message-Id: <1546479159-7611-1-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 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: - fix build error of CONFIG_MODVERSIONS scripts/Makefile.build | 4 ++-- scripts/Makefile.lib | 28 ++++++++++++++-------------- scripts/mkcompile_h | 4 ++-- 3 files changed, 18 insertions(+), 18 deletions(-) -- 2.7.4 diff --git a/scripts/Makefile.build b/scripts/Makefile.build index fd03d60..778e4fb 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 12b88d0..b44ae6c 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -270,7 +270,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'; \ @@ -280,7 +280,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) @@ -334,23 +334,23 @@ printf "%08x\n" $$dec_size | \ ) quiet_cmd_bzip2 = BZIP2 $@ -cmd_bzip2 = (cat $(filter-out FORCE,$^) | \ - bzip2 -9 && $(call size_append, $(filter-out FORCE,$^))) > $@ + cmd_bzip2 = cat $(filter-out FORCE,$^) | \ + bzip2 -9 && $(call size_append, $(filter-out FORCE,$^)) > $@ # Lzma # --------------------------------------------------------------------------- quiet_cmd_lzma = LZMA $@ -cmd_lzma = (cat $(filter-out FORCE,$^) | \ - lzma -9 && $(call size_append, $(filter-out FORCE,$^))) > $@ + cmd_lzma = cat $(filter-out FORCE,$^) | \ + lzma -9 && $(call size_append, $(filter-out FORCE,$^)) > $@ quiet_cmd_lzo = LZO $@ -cmd_lzo = (cat $(filter-out FORCE,$^) | \ - lzop -9 && $(call size_append, $(filter-out FORCE,$^))) > $@ + cmd_lzo = cat $(filter-out FORCE,$^) | \ + lzop -9 && $(call size_append, $(filter-out FORCE,$^)) > $@ quiet_cmd_lz4 = LZ4 $@ -cmd_lz4 = (cat $(filter-out FORCE,$^) | \ - lz4c -l -c1 stdin stdout && $(call size_append, $(filter-out FORCE,$^))) > $@ + cmd_lz4 = cat $(filter-out FORCE,$^) | \ + lz4c -l -c1 stdin stdout && $(call size_append, $(filter-out FORCE,$^)) > $@ # U-Boot mkimage # --------------------------------------------------------------------------- @@ -392,13 +392,13 @@ 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 $(filter-out FORCE,$^) | \ + cmd_xzkern = cat $(filter-out FORCE,$^) | \ sh $(srctree)/scripts/xz_wrap.sh && \ - $(call size_append, $(filter-out FORCE,$^))) > $@ + $(call size_append, $(filter-out FORCE,$^)) > $@ quiet_cmd_xzmisc = XZMISC $@ -cmd_xzmisc = (cat $(filter-out FORCE,$^) | \ - xz --check=crc32 --lzma2=dict=1MiB) > $@ + cmd_xzmisc = cat $(filter-out FORCE,$^) | \ + 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