Skip to content

Commit

Permalink
Kconfig: Simplify the conditional default statement
Browse files Browse the repository at this point in the history
Signed-off-by: Xiang Xiao <[email protected]>
  • Loading branch information
xiaoxiang781216 authored and acassis committed Jul 16, 2023
1 parent e031a73 commit abfe082
Show file tree
Hide file tree
Showing 55 changed files with 118 additions and 187 deletions.
3 changes: 1 addition & 2 deletions arch/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -667,8 +667,7 @@ endif # ARCH_STACK_DYNAMIC

config ARCH_KERNEL_STACK
bool "Kernel process stack"
default n if !LIBC_EXECFUNCS
default y if LIBC_EXECFUNCS
default LIBC_EXECFUNCS
depends on BUILD_KERNEL
---help---
It this option is selected, then every user process will have two
Expand Down
5 changes: 2 additions & 3 deletions arch/arm/src/armv7-m/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ config ARMV7M_HAVE_DCACHE

config ARMV7M_USEBASEPRI
bool "Use BASEPRI Register"
default y if ARCH_HIPRI_INTERRUPT
default ARCH_HIPRI_INTERRUPT
depends on ARCH_CORTEXM3 || ARCH_CORTEXM4 || ARCH_CORTEXM7
---help---
Use the BASEPRI register to enable and disable interrupts. By
Expand Down Expand Up @@ -88,8 +88,7 @@ config ARMV7M_DTCM

config ARMV7M_TARGET2_PREL
bool "R_ARM_TARGET2 is PC relative"
default n if !CXX_EXCEPTION
default y if CXX_EXCEPTION
default CXX_EXCEPTION
depends on LIBC_ARCH_ELF
---help---
Perform a PC relative relocation for relocation type R_ARM_TARGET2
Expand Down
3 changes: 1 addition & 2 deletions arch/arm/src/armv7-r/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ config ARMV7R_HAVE_PTM

config ARMV7R_MEMINIT
bool
default y if BOOT_SDRAM_DATA
default n if !BOOT_SDRAM_DATA
default BOOT_SDRAM_DATA
---help---
If this configuration *not* selected, then it is assumed that all
memory resources are initialized via arm_data_initialize() and
Expand Down
5 changes: 2 additions & 3 deletions arch/arm/src/armv8-m/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ config ARMV8M_HAVE_DCACHE

config ARMV8M_USEBASEPRI
bool "Use BASEPRI Register"
default y if ARCH_HIPRI_INTERRUPT
default ARCH_HIPRI_INTERRUPT
---help---
Use the BASEPRI register to enable and disable interrupts. By
default, the PRIMASK register is used for this purpose. This
Expand Down Expand Up @@ -69,8 +69,7 @@ config ARMV8M_DTCM

config ARMV8M_TARGET2_PREL
bool "R_ARM_TARGET2 is PC relative"
default n if !CXX_EXCEPTION
default y if CXX_EXCEPTION
default CXX_EXCEPTION
depends on LIBC_ARCH_ELF
---help---
Perform a PC relative relocation for relocation type R_ARM_TARGET2
Expand Down
3 changes: 1 addition & 2 deletions arch/arm/src/armv8-r/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ endif # ARMV8R_GIC_EOIMODE

config ARMV8R_MEMINIT
bool
default y if BOOT_SDRAM_DATA
default n if !BOOT_SDRAM_DATA
default BOOT_SDRAM_DATA
---help---
If this configuration *not* selected, then it is assumed that all
memory resources are initialized via arm_data_initialize() and
Expand Down
16 changes: 6 additions & 10 deletions arch/arm/src/cxd56xx/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,11 @@ config CXD56_XOSC_CLOCK

config CXD56_SPH
bool
default y if ASMP
default ASMP

config CXD56_PMIC
bool
default y if CXD56_MAINCORE
default n if CXD56_SUBCORE
default CXD56_MAINCORE

if CXD56_PMIC

Expand Down Expand Up @@ -106,8 +105,7 @@ config CXD56_CPUFIFO_NBUFFERS

config CXD56_FARAPI
bool
default y if CXD56_MAINCORE
default n if CXD56_SUBCORE
default CXD56_MAINCORE

menu "Far API Configuration"
depends on CXD56_FARAPI
Expand Down Expand Up @@ -1164,8 +1162,7 @@ menu "Storage Options"

menuconfig CXD56_SFC
bool "SPI Flash"
default n if CXD56_SUBCORE
default y
default !CXD56_SUBCORE
select MTD

if CXD56_SFC
Expand Down Expand Up @@ -1256,7 +1253,7 @@ endif # SPISD Configuration

config CXD56_EMMC
bool "eMMC"
default n if CXD56_SUBCORE
default n
---help---
Emmc driver for cxd56xx chip

Expand Down Expand Up @@ -1377,8 +1374,7 @@ if CXD56_TESTSET

config CXD56_TESTSET_WITH_HWSEM
bool "Use custom testset based on hardware semaphore"
default n if CXD56_USE_SYSBUS
default y if !CXD56_USE_SYSBUS
default !CXD56_USE_SYSBUS

endif

Expand Down
2 changes: 1 addition & 1 deletion arch/arm/src/cxd56xx/cxd56_emmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -870,7 +870,7 @@ static ssize_t cxd56_emmc_read(struct inode *inode,
DEBUGASSERT(inode && inode->i_private);
priv = (struct cxd56_emmc_state_s *)inode->i_private;

finfo("Read sector %" PRIu32 " (%u sectors) to %p\n",
finfo("Read sector %" PRIuOFF " (%u sectors) to %p\n",
start_sector, nsectors, buffer);

ret = cxd56_emmc_readsectors(priv, buffer, start_sector, nsectors);
Expand Down
16 changes: 6 additions & 10 deletions arch/arm/src/gd32f4/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -691,7 +691,7 @@ config ARCH_BOARD_GD32F4_CUSTOM_CLOCKCONFIG

config GD32F4_TCMEXCLUDE
bool "Exclude TCM SRAM from the heap"
default y if ARCH_DMA || LIBC_ARCH_ELF
default ARCH_DMA || LIBC_ARCH_ELF
depends on GD32F4_HAVE_TCM
---help---
Exclude TCM SRAM from the HEAP because it cannot be used for DMA
Expand Down Expand Up @@ -1192,8 +1192,7 @@ config GD32F4_ADC0_DMA
config GD32F4_ADC0_SCAN
bool "ADC0 scan mode"
depends on GD32F4_ADC0
default y if GD32F4_ADC0_DMA
default n
default GD32F4_ADC0_DMA

config GD32F4_ADC0_DMA_CFG
int "ADC0 DMA configuration"
Expand Down Expand Up @@ -1226,8 +1225,7 @@ config GD32F4_ADC1_DMA
config GD32F4_ADC1_SCAN
bool "ADC1 scan mode"
depends on GD32F4_ADC1
default y if GD32F4_ADC1_DMA
default n
default GD32F4_ADC1_DMA

config GD32F4_ADC1_DMA_CFG
int "ADC1 DMA configuration"
Expand Down Expand Up @@ -1260,8 +1258,7 @@ config GD32F4_ADC2_DMA
config GD32F4_ADC2_SCAN
bool "ADC2 scan mode"
depends on GD32F4_ADC2
default y if GD32F4_ADC2_DMA
default n
default GD32F4_ADC2_DMA

config GD32F4_ADC2_DMA_CFG
int "ADC2 DMA configuration"
Expand Down Expand Up @@ -2504,7 +2501,7 @@ config GD32F4_ENET_PTP

config GD32F4_RMII
bool "Use the reduced media-independent interface (RMII) interface"
default y if !GD32F4_MII
default !GD32F4_MII
---help---
Select Ethernet MII interface. The application can only select one of
the MII or RMII mode.
Expand Down Expand Up @@ -2566,8 +2563,7 @@ comment "USB Device Configuration"

config GD32F4_USB_ITRMP
bool "Re-map USB interrupt"
default n if !GD32F4_CAN1
default y if GD32F4_CAN1
default GD32F4_CAN1
depends on GD32F4_USB && GD32F4_GD32F4XX
---help---
The legacy USB in the F1 series shared interrupt lines with USB
Expand Down
3 changes: 1 addition & 2 deletions arch/arm/src/imx6/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,7 @@ config IMX_ENET_NTXBUFFERS

config IMX_ENET_ENHANCEDBD
bool # not optional
default n if ARMV7A_DCACHE_DISABLE
default y if !ARMV7A_DCACHE_DISABLE
default !ARMV7A_DCACHE_DISABLE

config IMX_ENET_NETHIFS
int # Not optional
Expand Down
3 changes: 1 addition & 2 deletions arch/arm/src/imxrt/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2191,8 +2191,7 @@ config IMXRT_ENET_NTXBUFFERS

config IMXRT_ENET_ENHANCEDBD
bool # not optional
default n if ARMV7M_DCACHE_WRITETHROUGH
default y if !ARMV7M_DCACHE_WRITETHROUGH
default !ARMV7M_DCACHE_WRITETHROUGH

config IMXRT_ENET_NETHIFS
int # Not optional
Expand Down
5 changes: 2 additions & 3 deletions arch/arm/src/lpc17xx_40xx/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,7 @@ menu "SDCARD Configuration"

config LPC17_40_SDCARD_DMA
bool "Support DMA data transfers"
default y if LPC17_40_GPDMA
default LPC17_40_GPDMA
select SDIO_DMA
depends on LPC17_40_GPDMA
---help---
Expand Down Expand Up @@ -867,8 +867,7 @@ config LPC17_40_ETH_HASH

config LPC17_40_MULTICAST
bool "Multicast"
default y if NET_MCASTGROUP
default n if !NET_MCASTGROUP
default NET_MCASTGROUP
---help---
Enable receipt of multicast (and unicast) frames. Automatically set
if NET_MCASTGROUP is selected.
Expand Down
18 changes: 9 additions & 9 deletions arch/arm/src/lpc43xx/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -77,48 +77,48 @@ endchoice # LPC43XX Chip Selection

config ARCH_FAMILY_LPC4310
bool
default y if ARCH_CHIP_LPC4310FBD144 || ARCH_CHIP_LPC4310FET100
default ARCH_CHIP_LPC4310FBD144 || ARCH_CHIP_LPC4310FET100
select ARCH_HAVE_TICKLESS

config ARCH_FAMILY_LPC4320
bool
default y if ARCH_CHIP_LPC4320FBD144 || ARCH_CHIP_LPC4320FET100
default ARCH_CHIP_LPC4320FBD144 || ARCH_CHIP_LPC4320FET100
select ARCH_HAVE_TICKLESS
select ARCH_HAVE_AHB_SRAM_BANK1

config ARCH_FAMILY_LPC4330
bool
default y if ARCH_CHIP_LPC4330FBD144 || ARCH_CHIP_LPC4330FET100 || ARCH_CHIP_LPC4330FET180 || ARCH_CHIP_LPC4330FET256 || ARCH_CHIP_LPC4337JET100
default ARCH_CHIP_LPC4330FBD144 || ARCH_CHIP_LPC4330FET100 || ARCH_CHIP_LPC4330FET180 || ARCH_CHIP_LPC4330FET256 || ARCH_CHIP_LPC4337JET100
select ARCH_HAVE_TICKLESS
select ARCH_HAVE_AHB_SRAM_BANK1

config ARCH_FAMILY_LPC4337
bool
default y if ARCH_CHIP_LPC4337JBD144 || ARCH_CHIP_LPC4337FET256
default ARCH_CHIP_LPC4337JBD144 || ARCH_CHIP_LPC4337FET256
select ARCH_HAVE_TICKLESS
select ARCH_HAVE_AHB_SRAM_BANK1

config ARCH_FAMILY_LPC4350
bool
default y if ARCH_CHIP_LPC4350FBD208 || ARCH_CHIP_LPC4350FET180 || ARCH_CHIP_LPC4350FET256
default ARCH_CHIP_LPC4350FBD208 || ARCH_CHIP_LPC4350FET180 || ARCH_CHIP_LPC4350FET256
select ARCH_HAVE_TICKLESS
select ARCH_HAVE_AHB_SRAM_BANK1

config ARCH_FAMILY_LPC4353
bool
default y if ARCH_CHIP_LPC4353FBD208 || ARCH_CHIP_LPC4353FET180 || ARCH_CHIP_LPC4353FET256
default ARCH_CHIP_LPC4353FBD208 || ARCH_CHIP_LPC4353FET180 || ARCH_CHIP_LPC4353FET256
select ARCH_HAVE_TICKLESS
select ARCH_HAVE_AHB_SRAM_BANK1

config ARCH_FAMILY_LPC4357
bool
default y if ARCH_CHIP_LPC4357FET180 || ARCH_CHIP_LPC4357FBD208 || ARCH_CHIP_LPC4357FET256
default ARCH_CHIP_LPC4357FET180 || ARCH_CHIP_LPC4357FBD208 || ARCH_CHIP_LPC4357FET256
select ARCH_HAVE_TICKLESS
select ARCH_HAVE_AHB_SRAM_BANK1

config ARCH_FAMILY_LPC4370
bool
default y if ARCH_CHIP_LPC4370FET100
default ARCH_CHIP_LPC4370FET100
select ARCH_HAVE_TICKLESS
select ARCH_HAVE_AHB_SRAM_BANK1

Expand Down Expand Up @@ -656,7 +656,7 @@ config LPC43_PHYSR_100FD

config LPC43_RMII
bool
default y if !LPC43_MII
default !LPC43_MII

config LPC43_ETHERNET_REGDEBUG
bool "Register-Level Debug"
Expand Down
3 changes: 1 addition & 2 deletions arch/arm/src/lpc54xx/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -867,8 +867,7 @@ config LPC54_ETH_RX_BROADCAST

config LPC54_ETH_RX_ALLMULTICAST
bool "Accept all multicast packets"
default y if NET_BROADCAST
default n if !NET_BROADCAST
default NET_BROADCAST
---help---
If selected, all received frames with a multicast destination
address (first bit in the destination address field is '1') are
Expand Down
3 changes: 1 addition & 2 deletions arch/arm/src/nrf52/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -828,8 +828,7 @@ config NRF52_SDC_LE_2M_PHY

config NRF52_SDC_LE_CODED_PHY
bool "Support LE Coded PHY"
default n if ARCH_CHIP_NRF52832
default y if ARCH_CHIP_NRF52840
default ARCH_CHIP_NRF52840
depends on NRF52_SDC_MULTIROLE

config NRF52_SDC_DLE
Expand Down
7 changes: 3 additions & 4 deletions arch/arm/src/nrf53/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ config NRF53_SPI_MASTER

config NRF53_IPC
bool
default y if RPTUN
default RPTUN

config NRF53_UART
bool
Expand Down Expand Up @@ -375,7 +375,7 @@ endif # NRF53_USE_HFCLK192M

config NRF53_OSCILLATOR_LFXO
bool "Configure LFXO oscillator"
default y if NRF53_LFCLK_XTAL
default NRF53_LFCLK_XTAL
depends on NRF53_APPCORE
---help---
Configure LFXO oscillator
Expand Down Expand Up @@ -777,8 +777,7 @@ config NRF53_SDC_LE_2M_PHY

config NRF53_SDC_LE_CODED_PHY
bool "Support LE Coded PHY"
default n if ARCH_CHIP_NRF53832
default y if ARCH_CHIP_NRF53840
default ARCH_CHIP_NRF53840
depends on NRF53_SDC_MULTIROLE

config NRF53_SDC_DLE
Expand Down
9 changes: 3 additions & 6 deletions arch/arm/src/sam34/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -437,8 +437,7 @@ config SAM34_NAND
config SAM34_OCD
bool "On-chip DEBUG (OCD)"
depends on ARCH_CHIP_SAM4L
default y if DEBUG_SYMBOLS
default n if !DEBUG_SYMBOLS
default DEBUG_SYMBOLS

config SAM34_PARC
bool "Parallel Capture (PARC)"
Expand Down Expand Up @@ -1083,16 +1082,14 @@ config SAM34_TC5_TIOB

config SAM34_ONESHOT
bool "TC one-shot wrapper"
default n if !SCHED_TICKLESS
default y if SCHED_TICKLESS
default SCHED_TICKLESS
---help---
Enable a wrapper around the low level timer/counter functions to
support one-shot timer.

config SAM34_FREERUN
bool "TC free-running wrapper"
default n if !SCHED_TICKLESS
default y if SCHED_TICKLESS
default SCHED_TICKLESS
---help---
Enable a wrapper around the low level timer/counter functions to
support a free-running timer.
Expand Down
Loading

0 comments on commit abfe082

Please sign in to comment.