From: Philip Oberfichtner <pro@denx.de>
To: Marek Vasut <marek.vasut@mailbox.org>
Cc: u-boot@lists.denx.de, Andre Przywara <andre.przywara@arm.com>,
Anshul Dalal <anshuld@ti.com>,
Dario Binacchi <dario.binacchi@amarulasolutions.com>,
Greg Malysa <malysagreg@gmail.com>,
Heinrich Schuchardt <heinrich.schuchardt@canonical.com>,
Ilias Apalodimas <ilias.apalodimas@linaro.org>,
Jerome Forissier <jerome.forissier@linaro.org>,
Nathan Barrett-Morrison <nathan.morrison@timesys.com>,
Oliver Gaskell <Oliver.Gaskell@analog.com>,
Paul Barker <paul.barker.ct@bp.renesas.com>,
Peng Fan <peng.fan@nxp.com>, Simon Glass <sjg@chromium.org>,
Tom Rini <trini@konsulko.com>,
Trevor Woerner <twoerner@gmail.com>, Ye Li <ye.li@nxp.com>
Subject: Re: [PATCH v3 4/5] Image size checks: Deduplicate Makefile
Date: Thu, 4 Sep 2025 10:30:19 +0200 [thread overview]
Message-ID: <aLlOG9of7r4sdLok@aristophanes> (raw)
In-Reply-To: <937b1be4-68cc-4853-94e5-2f14cbcef194@mailbox.org>
On Wed, Sep 03, 2025 at 03:02:20PM +0200, Marek Vasut wrote:
> On 9/3/25 12:56 PM, Philip Oberfichtner wrote:
> > Deduplicate some redundancies within the SIZE_CHECK code in the toplevel
> > Makefile. No functional changes.
> >
> > Note: To make this work for the special case of SPL, spl_size_limit.c
> > has to print an empty string "" instead of zero when there is no size
> > limit in place.
> >
> > Signed-off-by: Philip Oberfichtner <pro@denx.de>
> > ---
> > Makefile | 45 +++++++++++-------------------------------
> > tools/spl_size_limit.c | 4 ++--
> > 2 files changed, 13 insertions(+), 36 deletions(-)
> >
> > diff --git a/Makefile b/Makefile
> > index a17d8b57196..b6f01591ee9 100644
> > --- a/Makefile
> > +++ b/Makefile
> > @@ -428,8 +428,9 @@ KBUILD_HOSTLDLIBS := $(HOST_LFS_LIBS) $(HOSTLDLIBS)
> > # Check ths size of a binary:
> > # Args:
> > # $1: File to check
> > -# #2: Size limit in bytes (decimal or 0xhex)
> > +# #2: Size limit in bytes (decimal or 0xhex), always return OK if undefined
>
> You should be able to use the HAS_ variables to correctly test for and
> handle the undefined case .
In general, I agree. But this would mean to reintroduce the multiply
duplicated Makefile bloat à la:
ifeq ($(CONFIG_HAS_BOARD_SIZE_LIMIT),y)
BOARD_SIZE_CHECK= @ $(call size_check,$@,$(CONFIG_BOARD_SIZE_LIMIT))
else
BOARD_SIZE_CHECK =
endif
That's why after all I preferred my "test -z" solution. Is there maybe
a third way I am missing out on?
What do you think about giving size_check another argument, i.e.
call size_check,$@,$(CONFIG_HAS_BOARD_SIZE_LIMIT),$(CONFIG_BOARD_SIZE_LIMIT)
Any other suggestions?
next prev parent reply other threads:[~2025-09-04 8:30 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-03 10:56 [PATCH v3 0/5] Simplify image size checks Philip Oberfichtner
2025-09-03 10:56 ` [PATCH v3 1/5] Image size checks: Move all configs in one place Philip Oberfichtner
2025-09-03 12:50 ` Marek Vasut
2025-09-04 8:12 ` Philip Oberfichtner
2025-09-04 13:54 ` Marek Vasut
2025-09-05 8:13 ` Philip Oberfichtner
2025-09-05 14:22 ` Tom Rini
2025-10-10 14:19 ` Philip Oberfichtner
2025-09-03 10:56 ` [PATCH v3 2/5] Image size checks: Use HAS_SIZE_LIMIT consistently Philip Oberfichtner
2025-09-03 12:51 ` Marek Vasut
2025-09-04 8:19 ` Philip Oberfichtner
2025-09-04 13:56 ` Marek Vasut
2025-09-05 8:15 ` Philip Oberfichtner
2025-09-05 14:19 ` Tom Rini
2025-09-30 8:33 ` Philip Oberfichtner
2025-09-30 14:45 ` Tom Rini
2025-10-02 8:55 ` Philip Oberfichtner
2025-10-02 21:19 ` Tom Rini
2025-10-10 14:28 ` Philip Oberfichtner
2025-09-03 10:56 ` [PATCH v3 3/5] Image size checks: Use consistent help texts Philip Oberfichtner
2025-09-03 12:54 ` Marek Vasut
2025-09-04 8:20 ` Philip Oberfichtner
2025-09-03 10:56 ` [PATCH v3 4/5] Image size checks: Deduplicate Makefile Philip Oberfichtner
2025-09-03 13:02 ` Marek Vasut
2025-09-04 8:30 ` Philip Oberfichtner [this message]
2025-09-04 15:03 ` Marek Vasut
2025-09-05 8:22 ` Philip Oberfichtner
2025-09-03 10:56 ` [PATCH v3 5/5] Image size checks: Simplify SPL_SIZE_LIMIT logic Philip Oberfichtner
2025-09-03 12:08 ` Heinrich Schuchardt
2025-09-03 12:59 ` Marek Vasut
2025-09-04 8:23 ` Philip Oberfichtner
2025-09-04 8:30 ` Heinrich Schuchardt
2025-09-04 15:02 ` Marek Vasut
2025-09-05 8:19 ` Philip Oberfichtner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aLlOG9of7r4sdLok@aristophanes \
--to=pro@denx.de \
--cc=Oliver.Gaskell@analog.com \
--cc=andre.przywara@arm.com \
--cc=anshuld@ti.com \
--cc=dario.binacchi@amarulasolutions.com \
--cc=heinrich.schuchardt@canonical.com \
--cc=ilias.apalodimas@linaro.org \
--cc=jerome.forissier@linaro.org \
--cc=malysagreg@gmail.com \
--cc=marek.vasut@mailbox.org \
--cc=nathan.morrison@timesys.com \
--cc=paul.barker.ct@bp.renesas.com \
--cc=peng.fan@nxp.com \
--cc=sjg@chromium.org \
--cc=trini@konsulko.com \
--cc=twoerner@gmail.com \
--cc=u-boot@lists.denx.de \
--cc=ye.li@nxp.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.