All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Glass <sjg@chromium.org>
To: u-boot@lists.denx.de
Subject: [PATCH] common/board_f.c: use #ifdefs a little more consistently
Date: Thu, 27 Feb 2020 15:40:43 -0800	[thread overview]
Message-ID: <CAPnjgZ2sZ=fvOp-3ZMMv_aRDp63cDXC9EbYBvYyc5fHmGjj1Jg@mail.gmail.com> (raw)
In-Reply-To: <20200227081825.11039-1-rasmus.villemoes@prevas.dk>

Hi Rasmus,

On Thu, 27 Feb 2020 at 00:18, Rasmus Villemoes
<rasmus.villemoes@prevas.dk> wrote:
>
> Some init functions, e.g. print_resetinfo(), are conditionally defined
> depending on some config options, and are correspondingly
> conditionally included in the init_sequence_f[] array.
>
> Others are unconditionally defined and included in init_sequence_f[],
> but have their entire body, sans a mandatory "return 0", conditionally
> compiled.
>
> For the simple cases, switch to the former model, making it a bit more
> consistent. This also makes the U-Boot image very slightly smaller and
> avoids a few useless calls to no-op functions during board_init_f.

Can you check if it definitely does change the size? The reason I ask
is that it inlines those function calls in the normal case, at least
from my inspection.

Using if() is preferable to #if if there is no cost.

>
> Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
> ---
>  common/board_f.c | 54 ++++++++++++++++++++++++++++++++----------------
>  1 file changed, 36 insertions(+), 18 deletions(-)

Regards,
Simon

  reply	other threads:[~2020-02-27 23:40 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-27  8:18 [PATCH] common/board_f.c: use #ifdefs a little more consistently Rasmus Villemoes
2020-02-27 23:40 ` Simon Glass [this message]
2020-02-28  8:42   ` Rasmus Villemoes
2020-02-28 15:46     ` Tom Rini
2020-02-28 17:24       ` Rasmus Villemoes
2020-02-28 17:35         ` Tom Rini
2020-02-28 23:09           ` caching BLOBLISTT_SPL_HANDOFF (was Re: [PATCH] common/board_f.c: use #ifdefs a little more consistently) Rasmus Villemoes
2020-03-02 19:47             ` Simon Glass
2020-03-02 20:01               ` caching BLOBLISTT_SPL_HANDOFF Rasmus Villemoes
2020-03-04 23:11                 ` Simon Glass

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='CAPnjgZ2sZ=fvOp-3ZMMv_aRDp63cDXC9EbYBvYyc5fHmGjj1Jg@mail.gmail.com' \
    --to=sjg@chromium.org \
    --cc=u-boot@lists.denx.de \
    /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.