
Hi Simon,
-----Original Message----- From: Simon Glass sjg@chromium.org Sent: 10 March 2019 21:51 To: Ibai Erkiaga Elorza IBAIE@xilinx.com Cc: U-Boot Mailing List u-boot@lists.denx.de; Patrick Delaunay patrick.delaunay@st.com; Andy Shevchenko andriy.shevchenko@linux.intel.com; Bin Meng bmeng.cn@gmail.com; Patrice Chotard patrice.chotard@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-elorza@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-elorza@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.
Regards, Simon
Regards Ibai