diff mbox series

dm: ofnode: Fix compile breakage with OF_CHECKS enabled

Message ID 20200923062327.1787355-1-sr@denx.de
State Accepted
Commit 45dbe75da6fbc3de280021bf4b5c9dfc94c70f8f
Delegated to: Simon Glass
Headers show
Series dm: ofnode: Fix compile breakage with OF_CHECKS enabled | expand

Commit Message

Stefan Roese Sept. 23, 2020, 6:23 a.m. UTC
Include missing log.h and change _ofnode_to_np() to ofnode_to_np() so
that compiling with OF_CHECKS enabled does not break.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Simon Glass <sjg@chromium.org>
---
 include/dm/ofnode.h | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

Comments

Simon Glass Sept. 24, 2020, 6:54 p.m. UTC | #1
Hi Stefan,

On Wed, 23 Sep 2020 at 00:23, Stefan Roese <sr@denx.de> wrote:
>
> Include missing log.h and change _ofnode_to_np() to ofnode_to_np() so
> that compiling with OF_CHECKS enabled does not break.
>
> Signed-off-by: Stefan Roese <sr@denx.de>
> Cc: Simon Glass <sjg@chromium.org>
> ---
>  include/dm/ofnode.h | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)

Reviewed-by: Simon Glass <sjg@chromium.org>

We need to find a way to test this, perhaps by enabling it on one of
the sandbox builds and calling a few functions with invalid data.

Regards,
SImon
Simon Glass Oct. 5, 2020, 9:32 p.m. UTC | #2
Hi Stefan,

On Wed, 23 Sep 2020 at 00:23, Stefan Roese <sr@denx.de> wrote:
>
> Include missing log.h and change _ofnode_to_np() to ofnode_to_np() so
> that compiling with OF_CHECKS enabled does not break.
>
> Signed-off-by: Stefan Roese <sr@denx.de>
> Cc: Simon Glass <sjg@chromium.org>
> ---
>  include/dm/ofnode.h | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)

Reviewed-by: Simon Glass <sjg@chromium.org>

We need to find a way to test this, perhaps by enabling it on one of
the sandbox builds and calling a few functions with invalid data.

Regards,
SImon

Applied to u-boot-dm/next, thanks!
Stefan Roese Oct. 7, 2020, 4:58 a.m. UTC | #3
Hi Simon,

On 05.10.20 23:32, Simon Glass wrote:
> Hi Stefan,
> 
> On Wed, 23 Sep 2020 at 00:23, Stefan Roese <sr@denx.de> wrote:
>>
>> Include missing log.h and change _ofnode_to_np() to ofnode_to_np() so
>> that compiling with OF_CHECKS enabled does not break.
>>
>> Signed-off-by: Stefan Roese <sr@denx.de>
>> Cc: Simon Glass <sjg@chromium.org>
>> ---
>>   include/dm/ofnode.h | 7 ++++---
>>   1 file changed, 4 insertions(+), 3 deletions(-)
> 
> Reviewed-by: Simon Glass <sjg@chromium.org>
> 
> We need to find a way to test this, perhaps by enabling it on one of
> the sandbox builds and calling a few functions with invalid data.

Understood. I'll try to find some time for this in the next days.

Thanks,
Stefan
diff mbox series

Patch

diff --git a/include/dm/ofnode.h b/include/dm/ofnode.h
index 8df2facf99..d7852daf7f 100644
--- a/include/dm/ofnode.h
+++ b/include/dm/ofnode.h
@@ -10,6 +10,7 @@ 
 /* TODO(sjg@chromium.org): Drop fdtdec.h include */
 #include <fdtdec.h>
 #include <dm/of.h>
+#include <log.h>
 
 /* Enable checks to protect against invalid calls */
 #undef OF_CHECKS
@@ -84,7 +85,7 @@  struct ofprop {
 };
 
 /**
- * _ofnode_to_np() - convert an ofnode to a live DT node pointer
+ * ofnode_to_np() - convert an ofnode to a live DT node pointer
  *
  * This cannot be called if the reference contains an offset.
  *
@@ -182,8 +183,8 @@  static inline bool ofnode_is_np(ofnode node)
 	 * live tree is in use.
 	 */
 	assert(!ofnode_valid(node) ||
-	       (of_live_active() ? _ofnode_to_np(node)
-				  : _ofnode_to_np(node)));
+	       (of_live_active() ? ofnode_to_np(node)
+				  : ofnode_to_np(node)));
 #endif
 	return of_live_active() && ofnode_valid(node);
 }