diff options
author | Simon Glass <sjg@chromium.org> | 2019-09-25 08:56:28 -0600 |
---|---|---|
committer | Bin Meng <bmeng.cn@gmail.com> | 2019-10-08 13:57:45 +0800 |
commit | b51882d0079d3275bdb83ce49fdc8a90133f7f07 (patch) | |
tree | 3fdf9b80ff932dc134cc9703af20f1fb45ed6a54 /Makefile | |
parent | 27084c03d36a7f0e4d7c1679761e81567f1d5442 (diff) | |
download | u-boot-b51882d0079d3275bdb83ce49fdc8a90133f7f07.tar.gz |
spl: Convert CONFIG_SPL_SIZE_LIMIT to hex
This is currently a decimal value which is not as convenient or
meaningful. Also U-Boot tends to use hex everywhere.
Convert this option to hex and add a comment for the size_check macro.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Acked-by: Bin Meng <bmeng.cn@gmail.com>
[bmeng: correct the typo in the commit title]
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -337,14 +337,18 @@ endif # KBUILD_MODULES := 1 #endif +# Check ths size of a binary: +# Args: +# $1: File to check +# #2: Size limit in bytes (decimal or 0xhex) define size_check actual=$$( wc -c $1 | awk '{print $$1}'); \ limit=$$( printf "%d" $2 ); \ if test $$actual -gt $$limit; then \ echo "$1 exceeds file size limit:" >&2; \ - echo " limit: $$limit bytes" >&2; \ - echo " actual: $$actual bytes" >&2; \ - echo " excess: $$((actual - limit)) bytes" >&2; \ + echo " limit: $$(printf %#x bytes $$limit) bytes" >&2; \ + echo " actual: $$(printf %#x $$actual) bytes" >&2; \ + echo " excess: $$(printf %#x $$((actual - limit))) bytes" >&2;\ exit 1; \ fi endef |