Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1722831imu; Thu, 17 Jan 2019 02:07:13 -0800 (PST) X-Google-Smtp-Source: ALg8bN5lRoyy6ZAC9uKyoKCFAJAxUn0VA6DQYL0yGJIfLt788UHr9ulQfzap2IU7LNPsiM2gS595 X-Received: by 2002:a63:4d:: with SMTP id 74mr13118823pga.248.1547719632936; Thu, 17 Jan 2019 02:07:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547719632; cv=none; d=google.com; s=arc-20160816; b=riHgQCUKaJ/EGv2KpaFHvyxjMApXAY/sSqWWWKtRvD5cRUh4EBmKVmowGbaa7qFcuu 17WSquHFplPWFFW+br51jxsYpE7XZWSXB1km7bHUMDrGsF4VC4uZZDX+KKgcuLlw1e9X 4S/Pa4uqGBFInKdxuj+l1Hg+FWRGbg2cnCqNMx4o/Juj6/Y+8kLlqTBqEWXj2JVsC2Gc wgPXC5dZ7X6HNlm4UuBS5lA9sPX0YG09doGlSGpNB/ioZLEDkQ7gtSDC81NjzlaffB67 /bNFVQ2byf1NUjL9rmNHZClAJR8VNQNvrOyoIZ0ksmGguFgtIFMjmF3ZhHWNqHmVvMa0 fzDg== 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 b11si1076971pgt.289.2019.01.17.02.06.56; Thu, 17 Jan 2019 02:07: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=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 S1727491AbfAQKDg (ORCPT + 99 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(-) 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,$^) | \ -- 2.7.4