Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1659044imu; Thu, 17 Jan 2019 00:54:03 -0800 (PST) X-Google-Smtp-Source: ALg8bN6j1U/gLHGxh+x/xAp8rpaejE7037BEX14uGUe6uC9sOlanm0vGScJcsOlUOg453UzJoWB8 X-Received: by 2002:a62:1992:: with SMTP id 140mr14106862pfz.33.1547715243013; Thu, 17 Jan 2019 00:54:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547715242; cv=none; d=google.com; s=arc-20160816; b=Gp2ztmMjzB/ChB3Ohw+SrMMdqZhPirT9khAb73lci0rT0QvBkUVntsehXHvY4nCM+5 YDLlNrreEzFwKLtGdSEBPex7LeZnxqY80ebB8q+fkybMhpK/Rc1jd6jMNuQm7WIkbDSB 9NR/wPZ82LALQnVFeRfAOtbpmf9aRiHP/OvV8fJ3pcEvO0odqi8RZMGHhG0SyG5Mo9k0 70p2/YilGjXLSZt2Ge9uatQdNSajCULrDLbTzb8fsZOlps4gnT2yBBi9DE6iFmRMPwIh RCQE8vqM8Pyl2AsqtaBzIqmTwVQ3jtxKclzIiVt2ZjMy62DmAQuLRE0VlecApI/f/yH+ ncZw== 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=DeGTimLs2LDTF0UV0F/cvayXY2TZfd8t27YTASSPmfM=; b=wU3ga9aC0VIeYn85yEX4oD9gKBwajUmeIyBHhEnWdgyjlj+VfSYCPi99jKXjHTcI9S Kz+JWVuImo/JuXRGjXsQL0YGaW5eKC9vIOKkAaFfG0FXLK2uGeSK/z9HvqtuO3FQBg7u pirihxvkfrxY6/myMT9PWF2qpbSdwzMHPBsE0XtKHscFB6D4bv/8Zk1rffMmnEoS7BFo q31h7JCWmb7hZicX9wzRw3YD5YxBsp4fmrZ59h3144kFwQkRaqEZk+9Qktp/gO5Tg0Zl WusfbI7BucoLINygqYt0vXLRhH49+x7JV1XtwR661khf1t0UUX5PuvcDrhpA5Su7YnXU ZQ4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=kqnlTzrl; 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 p14si1145605plq.25.2019.01.17.00.53.47; Thu, 17 Jan 2019 00:54:02 -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=kqnlTzrl; 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 S1728570AbfAQELF (ORCPT + 99 others); Wed, 16 Jan 2019 23:11:05 -0500 Received: from conuserg-08.nifty.com ([210.131.2.75]:22827 "EHLO conuserg-08.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728525AbfAQELF (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 x0H4AYQb007102; Thu, 17 Jan 2019 13:10:34 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-08.nifty.com x0H4AYQb007102 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1547698234; bh=DeGTimLs2LDTF0UV0F/cvayXY2TZfd8t27YTASSPmfM=; h=From:To:Cc:Subject:Date:From; b=kqnlTzrlMSwg8JjpaxTOmqJktov4P0X058ZiUE096VHgLi9LZzzPw6LPYlcK3g++h cwKwXKhggYQHafV6PdmuA6ioUH1/4d42JFXk+lmMgo1zfeA1nYsoMJxCy+JHF1OepO o9ASRpIjF8dK1tpukxJh/s1m/tokzuLSGcM72rUY/Jp9ZAm8nS0lnIr1CJV/v9tHkD crVk9bSjvvMxUUIZw9k+SdDsQSEREYDC9Vw1+4dnsvjfkCdQxRNY368qt7QhzJbGpv qMKvH6C+zOD9mp9jEqgVzU0e8NHBToYg3jGLAPiW3vBm2EqzEksEQK4R2VO11izuzP zQ5yksCSP8QPw== 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 1/3] kbuild: simplify rules of data compression with size appending Date: Thu, 17 Jan 2019 13:10:29 +0900 Message-Id: <1547698231-20985-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 ...) can be omitted to expand a macro with no argument. Signed-off-by: Masahiro Yamada --- 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