Hi Ibai,

On Tue, 12 Mar 2019 at 15:19, Ibai Erkiaga Elorza <ib...@xilinx.com> wrote:
>
> Hi Simon,
>
> > -----Original Message-----
> > From: Simon Glass <s...@chromium.org>
> > Sent: 10 March 2019 21:51
> > To: Ibai Erkiaga Elorza <ib...@xilinx.com>
> > Cc: U-Boot Mailing List <u-boot@lists.denx.de>; Patrick Delaunay
> > <patrick.delau...@st.com>; Andy Shevchenko
> > <andriy.shevche...@linux.intel.com>; Bin Meng <bmeng...@gmail.com>;
> > Patrice Chotard <patrice.chot...@st.com>
> > Subject: Re: [U-Boot][PATCH] dm: check OF_LIVE is enabled
> >
> > Hi Ibai,
> >
> > On Tue, 26 Feb 2019 at 02:26, Ibai Erkiaga <ibai.erkiaga-elo...@xilinx.com>
> > wrote:
> > >
> > > Livetree implemented functions does not have conditional compilation
> > > so check if CONFIG_IS_ENABLED prior using those functions.
> > >
> > > The issue does not report any error in a normal build as the toolchain
> > > optimize the code. Using -O0 triggers the error so the patch is
> > > intended to fix issues on a ongoing effor to build U-Boot with -O0.
> > >
> > > Signed-off-by: Ibai Erkiaga <ibai.erkiaga-elo...@xilinx.com>
> > > ---
> > >
> > >  drivers/core/ofnode.c          | 60 
> > > +++++++++++++++++++++---------------------
> > >  drivers/serial/serial-uclass.c |  2 +-
> > >  2 files changed, 31 insertions(+), 31 deletions(-)
> > >
> >
> > This is supposed to work by using of_live_active(), which is called from
> > ofnode_is_np(). Instead of changing all this code, is it possible to update
> > of_live_active() somehow?
> >
>
> I've been trying to figure out it but I think there is no way just changing 
> of_live_active as the compiler does not discard branch statements with nested 
> fixed return values. I was able to make it work just changing ofnode_is_np 
> using pre-processor macro to set as false when OF_LIVE is not enabled, but 
> not sure if it the right approach. I will take a deeper look to the entire OF 
> code and maybe suggest a code refactoring.

Just returning false when OF_LIVE is not enabled seems fine to me. You
can never have an ofnode if livetree is not enabled.

Regards,
Simon
_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot

Reply via email to