diff options
| author | Simon Glass <[email protected]> | 2023-09-26 08:14:18 -0600 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2023-10-06 14:38:11 -0400 |
| commit | 52779874dac3f096f9f7893f0b3603aeff4c646b (patch) | |
| tree | a773075f0f15cdd2c26368b07a7f9f11870aff84 /include | |
| parent | 9cbdc3a0fca805bb1fd9ccf85114c504860814b9 (diff) | |
spl: Avoid #ifdef with CONFIG_SPL_SYS_MALLOC
Use IF_ENABLED_INT() to avoid needing to use the preprocessor.
Signed-off-by: Simon Glass <[email protected]>
Diffstat (limited to 'include')
| -rw-r--r-- | include/system-constants.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/include/system-constants.h b/include/system-constants.h index f0a191be590..dca6a86b01f 100644 --- a/include/system-constants.h +++ b/include/system-constants.h @@ -24,9 +24,14 @@ */ #ifdef CONFIG_SPL_HAS_CUSTOM_MALLOC_START #define SPL_SYS_MALLOC_START CONFIG_SPL_CUSTOM_SYS_MALLOC_ADDR -#else +#elif defined(CONFIG_SPL_BSS_START_ADDR) #define SPL_SYS_MALLOC_START (CONFIG_SPL_BSS_START_ADDR + \ CONFIG_SPL_BSS_MAX_SIZE) +#else +/* feature not enabled: this value avoids compiler errors but is not used */ +#define SPL_SYS_MALLOC_START 0 #endif +#define SPL_SYS_MALLOC_SIZE \ + IF_ENABLED_INT(CONFIG_SPL_SYS_MALLOC, CONFIG_SPL_SYS_MALLOC_SIZE) #endif |
