[PATCH 1/5] common: board: Simplify array with function pointers with CONFIG_IS_ENABLED
Ilias Apalodimas
ilias.apalodimas at linaro.org
Wed Dec 18 13:15:08 CET 2024
On Wed, 18 Dec 2024 at 14:03, Ilias Apalodimas
<ilias.apalodimas at linaro.org> wrote:
>
> Hi Jerome,
>
>
> This doesn't apply on -master, can you rebase it? OR was it meant for -next?
nvm it's on -next
>
> Thanks
> /Ilias
>
> On Tue, 17 Dec 2024 at 18:00, Jerome Forissier
> <jerome.forissier at linaro.org> wrote:
> >
> > From: Michal Simek <michal.simek at amd.com>
> >
> > Convert all simple cases where current ifdef is used with using
> > CONFIG_IS_ENABLED.
> > The change doesn't have impact on code size and it is only cleaning up
> > description.
> >
> > Checkpatch is reporting issue:
> > space required after that ',' (ctx:VxB)
> >
> > When space is there another warning is coming up:
> > space prohibited before that close parenthesis ')'
> >
> > but there is no way how to fix it that's why leave it like it is.
> >
> > Signed-off-by: Michal Simek <michal.simek at amd.com>
> > Reviewed-by: Tom Rini <trini at konsulko.com>
> > [jf: s/Simply/Simplify/ in subject]
> > Signed-off-by: Jerome Forissier <jerome.forissier at linaro.org>
> > ---
> > common/board_f.c | 49 +++++-------------
> > common/board_r.c | 128 ++++++++++++-----------------------------------
> > 2 files changed, 46 insertions(+), 131 deletions(-)
> >
> > diff --git a/common/board_f.c b/common/board_f.c
> > index 54c48d42ee9..a4d8850cb7d 100644
> > --- a/common/board_f.c
> > +++ b/common/board_f.c
> > @@ -872,12 +872,8 @@ static int initf_upl(void)
> >
> > static const init_fnc_t init_sequence_f[] = {
> > setup_mon_len,
> > -#ifdef CONFIG_OF_CONTROL
> > - fdtdec_setup,
> > -#endif
> > -#ifdef CONFIG_TRACE_EARLY
> > - trace_early_init,
> > -#endif
> > + CONFIG_IS_ENABLED(OF_CONTROL, (fdtdec_setup,))
> > + CONFIG_IS_ENABLED(TRACE_EARLY, (trace_early_init,))
This looks fine and I am nitpicking but the last comma seems
unnecessary. Can we remove it, or that's just CONFIG_IS_ENABLED()
works?
> > initf_malloc,
> > initf_upl,
> > log_init,
> > @@ -885,16 +881,12 @@ static const init_fnc_t init_sequence_f[] = {
> > event_init,
> > bloblist_maybe_init,
> > setup_spl_handoff,
>
[...]
Thanks
/Ilias
More information about the U-Boot
mailing list