linker: undefine the no-ops dt macros at the end of the file

Undefine the DT_NODE_HAS_STATUS and DT_NODE_HAS_STATUS_OKAY no nop at
the end of the file so other uses can include devicetree.h without
generating a compiler warning.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
This commit is contained in:
Fabio Baltieri 2024-12-12 17:14:51 +00:00 committed by Benjamin Cabé
parent 7635455f15
commit 274c848571

View file

@ -28,7 +28,7 @@
/* We need to dummy out DT_NODE_HAS_STATUS when building the unittests. /* We need to dummy out DT_NODE_HAS_STATUS when building the unittests.
* Including devicetree.h would require generating dummy header files * Including devicetree.h would require generating dummy header files
* to match what gen_defines creates, so it's easier to just dummy out * to match what gen_defines creates, so it's easier to just dummy out
* DT_NODE_HAS_STATUS. * DT_NODE_HAS_STATUS. These are undefined at the end of the file.
*/ */
#ifdef ZTEST_UNITTEST #ifdef ZTEST_UNITTEST
#define DT_NODE_HAS_STATUS(node, status) 0 #define DT_NODE_HAS_STATUS(node, status) 0
@ -359,4 +359,9 @@ extern char lnkr_ondemand_rodata_size[];
#endif /* CONFIG_LINKER_USE_ONDEMAND_SECTION */ #endif /* CONFIG_LINKER_USE_ONDEMAND_SECTION */
#endif /* ! _ASMLANGUAGE */ #endif /* ! _ASMLANGUAGE */
#ifdef ZTEST_UNITTEST
#undef DT_NODE_HAS_STATUS
#undef DT_NODE_HAS_STATUS_OKAY
#endif
#endif /* ZEPHYR_INCLUDE_LINKER_LINKER_DEFS_H_ */ #endif /* ZEPHYR_INCLUDE_LINKER_LINKER_DEFS_H_ */