summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvgeny Bachinin <EABachinin@salutedevices.com>2024-12-11 01:39:58 +0300
committerTom Rini <trini@konsulko.com>2024-12-31 10:57:50 -0600
commite2f0e9a320d1efba9ed280e9a4b14df661daef54 (patch)
tree9f02eb01ec515d2c93024ceaa009cfa99fed9c51
parent623f5cf517ae0e0f6f7132ac6411ea0a8dd9b3f7 (diff)
fdtdec: dtb_dt_embedded: replace ifdefs by IS_ENABLED()
Patch fixes the checkpatch warnings like: ``` WARNING: Use 'if (IS_ENABLED(CONFIG...))' instead of '#if or #ifdef' #94: FILE: lib/fdtdec.c:102: +#ifdef CONFIG_OF_EMBED ``` Signed-off-by: Evgeny Bachinin <EABachinin@salutedevices.com> Reviewed-by: Simon Glass <sjg@chromium.org>
-rw-r--r--lib/fdtdec.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/lib/fdtdec.c b/lib/fdtdec.c
index 9cb94a15844..7f141889086 100644
--- a/lib/fdtdec.c
+++ b/lib/fdtdec.c
@@ -99,15 +99,15 @@ extern u8 __dtb_dt_spl_begin[]; /* embedded device tree blob for SPL/TPL */
/* Get a pointer to the embedded devicetree, if there is one, else NULL */
static u8 *dtb_dt_embedded(void)
{
-#ifdef CONFIG_OF_EMBED
-# ifdef CONFIG_XPL_BUILD
- return __dtb_dt_spl_begin;
-# else
- return __dtb_dt_begin;
-# endif
-#else
- return NULL;
-#endif
+ u8 *addr = NULL;
+
+ if (IS_ENABLED(CONFIG_OF_EMBED)) {
+ addr = __dtb_dt_begin;
+
+ if (IS_ENABLED(CONFIG_XPL_BUILD))
+ addr = __dtb_dt_spl_begin;
+ }
+ return addr;
}
const char *fdtdec_get_srcname(void)