kconfig: Factor out HAS_FLASH_LOAD_OFFSET dependency

Use a top-level 'if' instead of three separate 'depends on'. They're
exactly equivalent (top-level 'if's are just a shorthand for adding
'depends on' to each item within the 'if').

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
This commit is contained in:
Ulf Magnusson 2019-11-16 01:33:09 +01:00 committed by Anas Nashif
parent 90b9eb3a9e
commit fd9981a7c4

View file

@ -85,9 +85,10 @@ config HAS_FLASH_LOAD_OFFSET
This option is selected by targets having a FLASH_LOAD_OFFSET This option is selected by targets having a FLASH_LOAD_OFFSET
and FLASH_LOAD_SIZE. and FLASH_LOAD_SIZE.
if HAS_FLASH_LOAD_OFFSET
config USE_DT_CODE_PARTITION config USE_DT_CODE_PARTITION
bool "Link application into /chosen/zephyr,code-partition from devicetree" bool "Link application into /chosen/zephyr,code-partition from devicetree"
depends on HAS_FLASH_LOAD_OFFSET
help help
When enabled, the application will be linked into the flash partition When enabled, the application will be linked into the flash partition
selected by the zephyr,code-partition property in /chosen in devicetree. selected by the zephyr,code-partition property in /chosen in devicetree.
@ -102,7 +103,6 @@ config FLASH_LOAD_OFFSET
hex "Kernel load offset" if !USE_DT_CODE_PARTITION hex "Kernel load offset" if !USE_DT_CODE_PARTITION
default $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) if USE_DT_CODE_PARTITION default $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) if USE_DT_CODE_PARTITION
default 0 default 0
depends on HAS_FLASH_LOAD_OFFSET
help help
This option specifies the byte offset from the beginning of flash that This option specifies the byte offset from the beginning of flash that
the kernel should be loaded into. Changing this value from zero will the kernel should be loaded into. Changing this value from zero will
@ -116,7 +116,6 @@ config FLASH_LOAD_SIZE
hex "Kernel load size" if !USE_DT_CODE_PARTITION hex "Kernel load size" if !USE_DT_CODE_PARTITION
default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) if USE_DT_CODE_PARTITION default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) if USE_DT_CODE_PARTITION
default 0 default 0
depends on HAS_FLASH_LOAD_OFFSET
help help
If non-zero, this option specifies the size, in bytes, of the flash If non-zero, this option specifies the size, in bytes, of the flash
area that the Zephyr image will be allowed to occupy. If zero, the area that the Zephyr image will be allowed to occupy. If zero, the
@ -125,6 +124,8 @@ config FLASH_LOAD_SIZE
If unsure, leave at the default value 0. If unsure, leave at the default value 0.
endif # HAS_FLASH_LOAD_OFFSET
config TEXT_SECTION_OFFSET config TEXT_SECTION_OFFSET
hex hex
prompt "TEXT section offset" if !BOOTLOADER_MCUBOOT prompt "TEXT section offset" if !BOOTLOADER_MCUBOOT