All of lore.kernel.org
 help / color / mirror / Atom feed
From: Leo Liang <ycliang@andestech.com>
To: Bin Meng <bmeng.cn@gmail.com>
Cc: Rick Chen <rick@andestech.com>,
	U-Boot Mailing List <u-boot@lists.denx.de>
Subject: Re: [PATCH] riscv: ae350: Use #if defined instead of CONFIG_IS_ENABLED
Date: Mon, 1 Nov 2021 15:49:07 +0800	[thread overview]
Message-ID: <YX+b849kEHxU520V@ubuntu02> (raw)
In-Reply-To: <CAEUhbmVhbHUsKOqywG0K324e7Y1fumxRg53MJC4nC0ugEuE4XQ@mail.gmail.com>

Hi Bin,
On Mon, Nov 01, 2021 at 02:04:48PM +0800, Bin Meng wrote:
> Hi Leo,
> 
> On Wed, Oct 27, 2021 at 4:59 PM Leo Yu-Chi Liang <ycliang@andestech.com> wrote:
> >
> > According to ./include/linux/kconfig.h,
> > CONFIG_IS_ENABLED(OF_BOARD) expands to 0
> > when CONFIG_SPL_BUILD is defined because
> > there is no CONFIG_SPL_OF_BOARD.
> 
> Why is the change?
> 

The original code was

void *board_fdt_blob_setup(void)
{
#if CONFIG_IS_ENABLED(OF_BOARD)
 	return (void *)(ulong)gd->arch.firmware_fdt_addr;
#elif CONFIG_IS_ENABLED(OF_SEPARATE)
 	return (void *)CONFIG_SYS_FDT_BASE;
#else
 	return NULL;
}

But the "return (void *)(ulong)gd->arch.firmware_fdt_addr;" does not get
compiled even if OF_BOARD is selected when building
ae350_*_spl_*_defconfig, thus this patch.

The reason is because ./include/linux/kconfig.h states
"CONFIG_IS_ENABLED(FOO) expands to 1 if CONFIG_SPL_BUILD is defined
and CONFIG_SPL_FOO is set to 'y'". 
However, we don't have CONFIG_SPL_OF_BOARD, so
CONFIG_IS_ENABLED(OF_BOARD) only expands to 0.

Best regards,
Leo

> >
> > Use #if defined instead.
> >
> > Signed-off-by: Leo Yu-Chi Liang <ycliang@andestech.com>
> > ---
> >  board/AndesTech/ax25-ae350/ax25-ae350.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> 
> Regards,
> Bin

  reply	other threads:[~2021-11-01  7:49 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-27  8:59 [PATCH] riscv: ae350: Use #if defined instead of CONFIG_IS_ENABLED Leo Yu-Chi Liang
     [not found] ` <HK0PR03MB2994A2BC40279DC7AF913DE2C18A9@HK0PR03MB2994.apcprd03.prod.outlook.com>
2021-11-01  5:41   ` Rick Chen
2021-11-01  6:04 ` Bin Meng
2021-11-01  7:49   ` Leo Liang [this message]
2021-11-01  8:37     ` Bin Meng
2021-11-01  8:56       ` Leo Liang

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=YX+b849kEHxU520V@ubuntu02 \
    --to=ycliang@andestech.com \
    --cc=bmeng.cn@gmail.com \
    --cc=rick@andestech.com \
    --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.