From patchwork Thu Jan 17 10:02:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 155809 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp1765549jaa; Thu, 17 Jan 2019 02:03:53 -0800 (PST) X-Google-Smtp-Source: ALg8bN4dMqyCYGNqE30Ak87RztFFIANvuIk0AzrCmAMQs8/UffOhMelI2+srWp9tpWlRjloRazkr X-Received: by 2002:a63:6ecf:: with SMTP id j198mr13135771pgc.3.1547719433142; Thu, 17 Jan 2019 02:03:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547719433; cv=none; d=google.com; s=arc-20160816; b=QK264zPHHpCeGpWtwpAJERXTGzt8VHLW73eIdyGrB9hSe0yT8yq5qu/5AVBdllwSY+ 8U0Kg02Gy18q7Oi3MBGj46mX0bq1YLfhAbkheasylh24lXzFQzhQs62mhC8vzmUgBJG6 pUP0xwIZbaf37W273dVkOBhC1hit3fPh7PUlejmoymM3uVZkBa9xxv4Wr6MkS2+zQZ3t WntKYS1+lkB+Lr7sDdsYsuy0nvdhaFAdiNBkAGHEjBiVCk6dc1XOxcj118OPfgTh1Wzn yrnvoMZ4WYXDvB1AANFb2ZYL0PkU7Q6uJknmL6zwYLwkjaLSLd2/EHcsK/Nu5byobfds ms0A== 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=HJfElWjeDdYHGcIw2ZLEvlLvoV4a0ENSRIiBQO5miwQ=; b=ElKzGI09bpgixi06g4jccTzAwSDysqY6wqaaS6ZjjFbJkKjO/53mL1g6BT8jgTQuv0 Fmaeq9Llc45+Cxt/QzPU7eTA6eu8F03WPBt3Sw9O2gZLtemhjcSf5aDGsll7ZQLUaZQ+ BCtNLq9s+g3gJ8NoQbYkAxjFNJJGpv8tzDSzK3H8ytgMQfIxe/DgzK9vpejKiDTm47QA 97RE4liGhWMuwSGpilclsW7m+4JaitlIJFALL7EU5j3aCV5xjrXxlWljSp9I8Pa8IiG8 zWcCg7X86dQY9J5Z6hk0N+3oYgGB/aZiRAvcqwUyYWax3vkCc1qv2SC08GV+c+qqInF7 2wwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=V86PDZ4p; 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 g10si1389602plm.1.2019.01.17.02.03.52; Thu, 17 Jan 2019 02:03:53 -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=V86PDZ4p; 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 S1727509AbfAQKDg (ORCPT + 10 others); Thu, 17 Jan 2019 05:03:36 -0500 Received: from conuserg-11.nifty.com ([210.131.2.78]:49374 "EHLO conuserg-11.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726948AbfAQKDf (ORCPT ); Thu, 17 Jan 2019 05:03:35 -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 x0HA38Gq009525; Thu, 17 Jan 2019 19:03:08 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com x0HA38Gq009525 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1547719389; bh=HJfElWjeDdYHGcIw2ZLEvlLvoV4a0ENSRIiBQO5miwQ=; h=From:To:Cc:Subject:Date:From; b=V86PDZ4pL4auDigpLKcpBBTkpbujgL6NOg3W2y1MRllItAie8rzrD+0zHiSLNg9ZU vTOto6IQIygEELgcf0ZGud/iWqY31khHJJmvNc7jEKa5ZQDu/zQcc0ExnqIECXH/sv BOnAMQTOIYpTYZpAKQol/SSMKCaxLYJcbWbRYRGxgn0XESzggseYY3jlUeWmp2qW3A tG2RJmZ9mT2yFfk+9a5q1GyJtBcxOL1V7h4CiSOjFfw5AS9KuzjX1sJfBGVKjYJYFd SNTHLmqILz4g4JRKM4toMZ3tbtzPsbOdvfSsJoWXUQeiQo+BnoGoaNOcQLtzYK/jem nED4yGHWPVK6w== 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 1/4] kbuild: simplify rules of data compression with size appending Date: Thu, 17 Jan 2019 19:02:41 +0900 Message-Id: <1547719364-18849-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 All the callers of size_append pass $(filter-out FORCE,$^). Move $(filter-out FORCE,$^) to the definition of size_append. This makes the callers cleaner because $(call ...) is unneeded for a macro with no argument. Signed-off-by: Masahiro Yamada --- Changes in v2: None scripts/Makefile.lib | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) -- 2.7.4 diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index ecad15b..ebaa348 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -321,7 +321,7 @@ dtc-tmp = $(subst $(comma),_,$(dot-target).dts.tmp) # append the size as a 32-bit littleendian number as gzip does. size_append = printf $(shell \ dec_size=0; \ -for F in $1; do \ +for F in $(filter-out FORCE,$^); do \ fsize=$$($(CONFIG_SHELL) $(srctree)/scripts/file-size.sh $$F); \ dec_size=$$(expr $$dec_size + $$fsize); \ done; \ @@ -335,23 +335,20 @@ 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 && $(size_append)) > $@ # 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 && $(size_append)) > $@ 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 && $(size_append)) > $@ 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 && \ + $(size_append)) > $@ # U-Boot mkimage # --------------------------------------------------------------------------- @@ -394,8 +391,7 @@ quiet_cmd_uimage = UIMAGE $@ # decompression mode. A BCJ filter isn't used either. quiet_cmd_xzkern = XZKERN $@ cmd_xzkern = (cat $(filter-out FORCE,$^) | \ - sh $(srctree)/scripts/xz_wrap.sh && \ - $(call size_append, $(filter-out FORCE,$^))) > $@ + sh $(srctree)/scripts/xz_wrap.sh && $(size_append)) > $@ quiet_cmd_xzmisc = XZMISC $@ cmd_xzmisc = (cat $(filter-out FORCE,$^) | \