Skip to contentSkip to conversation

dm: Fix util.h's broken include guard

PATCH In review Pierre-Clément Tosi 2 participants 2 messages Sep 30, 2021 – Oct 21, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dm: Fix util.h's broken include guard

Fix up the header's include guard to contain the definition of dm_priv_to_rw(), which was erroneously added outside of it, by moving its #endif to the end of the file (i.e. where it belongs). This removes the risk of compilation errors resulting from the redefinition of that function where the header might have been (indirectly) included more than once.

Fixes cfb9c9b77c2 ("dm: core: Use separate priv/plat data region")
Cc Simon Glass <[email protected]>
---
 include/dm/util.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
include/dm/util.h +2 -2
index c634e470e7..17baf55c25 100644
@@ -48,8 +48,6 @@ void dm_dump_driver_compat(void);
 /* Dump out a list of drivers with static platform data */
 void dm_dump_static_driver_info(void);
 
-#endif
-
 #if CONFIG_IS_ENABLED(OF_PLATDATA_INST) && CONFIG_IS_ENABLED(READ_ONLY)
 void *dm_priv_to_rw(void *priv);
 #else
@@ -58,3 +56,5 @@ static inline void *dm_priv_to_rw(void *priv)
 	return priv;
 }
 #endif
+
+#endif
Signature · 1 line
2.33.0.685.g46640cef36-goog
#1 lore raw

Fix up the header's include guard to contain the definition of dm_priv_to_rw(), which was erroneously added outside of it, by moving its #endif to the end of the file (i.e. where it belongs). This removes the risk of compilation errors resulting from the redefinition of that function where the header might have been (indirectly) included more than once.

Fixes cfb9c9b77c2 ("dm: core: Use separate priv/plat data region")
Cc Simon Glass <[email protected]>
---
 include/dm/util.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Applied to u-boot-dm, thanks!