Skip to content

Commit ecbd10d

Browse files
committed
kbuild: simplify rules of data compression with size appending
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 <yamada.masahiro@socionext.com>
1 parent d151e97 commit ecbd10d

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

scripts/Makefile.lib

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ dtc-tmp = $(subst $(comma),_,$(dot-target).dts.tmp)
321321
# append the size as a 32-bit littleendian number as gzip does.
322322
size_append = printf $(shell \
323323
dec_size=0; \
324-
for F in $1; do \
324+
for F in $(filter-out FORCE,$^); do \
325325
fsize=$$($(CONFIG_SHELL) $(srctree)/scripts/file-size.sh $$F); \
326326
dec_size=$$(expr $$dec_size + $$fsize); \
327327
done; \
@@ -335,23 +335,20 @@ printf "%08x\n" $$dec_size | \
335335
)
336336

337337
quiet_cmd_bzip2 = BZIP2 $@
338-
cmd_bzip2 = (cat $(filter-out FORCE,$^) | \
339-
bzip2 -9 && $(call size_append, $(filter-out FORCE,$^))) > $@
338+
cmd_bzip2 = (cat $(filter-out FORCE,$^) | bzip2 -9 && $(size_append)) > $@
340339

341340
# Lzma
342341
# ---------------------------------------------------------------------------
343342

344343
quiet_cmd_lzma = LZMA $@
345-
cmd_lzma = (cat $(filter-out FORCE,$^) | \
346-
lzma -9 && $(call size_append, $(filter-out FORCE,$^))) > $@
344+
cmd_lzma = (cat $(filter-out FORCE,$^) | lzma -9 && $(size_append)) > $@
347345

348346
quiet_cmd_lzo = LZO $@
349-
cmd_lzo = (cat $(filter-out FORCE,$^) | \
350-
lzop -9 && $(call size_append, $(filter-out FORCE,$^))) > $@
347+
cmd_lzo = (cat $(filter-out FORCE,$^) | lzop -9 && $(size_append)) > $@
351348

352349
quiet_cmd_lz4 = LZ4 $@
353-
cmd_lz4 = (cat $(filter-out FORCE,$^) | \
354-
lz4c -l -c1 stdin stdout && $(call size_append, $(filter-out FORCE,$^))) > $@
350+
cmd_lz4 = (cat $(filter-out FORCE,$^) | lz4c -l -c1 stdin stdout && \
351+
$(size_append)) > $@
355352

356353
# U-Boot mkimage
357354
# ---------------------------------------------------------------------------
@@ -394,8 +391,7 @@ quiet_cmd_uimage = UIMAGE $@
394391
# decompression mode. A BCJ filter isn't used either.
395392
quiet_cmd_xzkern = XZKERN $@
396393
cmd_xzkern = (cat $(filter-out FORCE,$^) | \
397-
sh $(srctree)/scripts/xz_wrap.sh && \
398-
$(call size_append, $(filter-out FORCE,$^))) > $@
394+
sh $(srctree)/scripts/xz_wrap.sh && $(size_append)) > $@
399395

400396
quiet_cmd_xzmisc = XZMISC $@
401397
cmd_xzmisc = (cat $(filter-out FORCE,$^) | \

0 commit comments

Comments
 (0)