[PATCH 1/2] Fix usage of CONFIG_PREBOOT

Pali Rohár pali at kernel.org
Tue Jul 12 13:18:27 CEST 2022


On Tuesday 12 July 2022 04:58:51 Simon Glass wrote:
> Hi Pali,
> 
> On Sun, 10 Jul 2022 at 05:43, Pali Rohár <pali at kernel.org> wrote:
> >
> > Due to usage of PREBOOT in Kconfig, macro CONFIG_PREBOOT is always defined
> > when CONFIG_USE_PREBOOT is enabled. In case CONFIG_PREBOOT is not
> > explicitly enabled it is set to empty C string and therefore
> > '#ifdef CONFIG_PREBOOT' guard does not work. Fix this issue by introducing
> > a new Kconfig symbol PREBOOT_DEFINED which cause to define new C macro
> > CONFIG_PREBOOT_DEFINED only when CONFIG_PREBOOT is really defined.
> >
> > Change usage of '#ifdef CONFIG_PREBOOT' by '#ifdef CONFIG_USE_PREBOOT' for
> > code which checks if preboot code would be called and by
> > '#ifdef CONFIG_PREBOOT_DEFINED' for defining preboot code.
> >
> > Signed-off-by: Pali Rohár <pali at kernel.org>
> > ---
> >  board/boundary/nitrogen6x/nitrogen6x.c | 4 ++--
> >  boot/Kconfig                           | 4 ++++
> >  include/env_default.h                  | 2 +-
> >  3 files changed, 7 insertions(+), 3 deletions(-)
> 
> Can you not use:
> 
> #idef CONFIG_USE_PREBOOT
> 
> ?

Where?

> You should not be checking for the existence of a string Kconfig.

I do not see other option, because this is how kconfig is working. When
string option is not set then kconfig defines it to empty string.

> Regards,
> Simon


More information about the U-Boot mailing list