From patchwork Thu Jan 17 04:10:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 155781 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp1478316jaa; Wed, 16 Jan 2019 20:11:06 -0800 (PST) X-Google-Smtp-Source: ALg8bN6LB//DpUW++bo1+TgsV2fADBj13OJnJEyx8iMa3yBrAx4Duf1uxpFJFVakbzoddqKZHu5i X-Received: by 2002:a62:1c0a:: with SMTP id c10mr13304362pfc.213.1547698266755; Wed, 16 Jan 2019 20:11:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547698266; cv=none; d=google.com; s=arc-20160816; b=l6NV1KIsGooajun+39mACyFsrbnmJVuHZZhG3+eUFFaYlXWuDrcKnI1EXILan3hSfv zeqSh1xfT7tDiaFFtnN+j6/4FY500txv7tGTA39MZvSbjO3ORBVrAmGcHBCLGo0/EMpQ CS3DeHqTjNmm3kjGkAIgCGUVqY458HjPS/zUoeFCxgdFHBUye5MwA34FWgR0eN+1oh+j R79zJqh4WufEDwJqY8bU2I1krJ9Ax6YRtUmYI6dxfM0bk1X0yA8KhZ5Ae+EBnIjDEvsH 74W09zVPsNMbUdbQTznd050fVOBGN62HGubCOFtGCfDTKGrDbatQO0aWpYcHQ6j8hk4H NW2g== 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 q7si433893pgl.303.2019.01.16.20.11.06; Wed, 16 Jan 2019 20:11:06 -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 S1728579AbfAQELF (ORCPT + 23 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(-) -- 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,$^) | \