Skip to content

Commit abfe082

Browse files
xiaoxiang781216acassis
authored andcommitted
Kconfig: Simplify the conditional default statement
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
1 parent e031a73 commit abfe082

File tree

55 files changed

+118
-187
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+118
-187
lines changed

arch/Kconfig

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -667,8 +667,7 @@ endif # ARCH_STACK_DYNAMIC
667667

668668
config ARCH_KERNEL_STACK
669669
bool "Kernel process stack"
670-
default n if !LIBC_EXECFUNCS
671-
default y if LIBC_EXECFUNCS
670+
default LIBC_EXECFUNCS
672671
depends on BUILD_KERNEL
673672
---help---
674673
It this option is selected, then every user process will have two

arch/arm/src/armv7-m/Kconfig

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ config ARMV7M_HAVE_DCACHE
1515

1616
config ARMV7M_USEBASEPRI
1717
bool "Use BASEPRI Register"
18-
default y if ARCH_HIPRI_INTERRUPT
18+
default ARCH_HIPRI_INTERRUPT
1919
depends on ARCH_CORTEXM3 || ARCH_CORTEXM4 || ARCH_CORTEXM7
2020
---help---
2121
Use the BASEPRI register to enable and disable interrupts. By
@@ -88,8 +88,7 @@ config ARMV7M_DTCM
8888

8989
config ARMV7M_TARGET2_PREL
9090
bool "R_ARM_TARGET2 is PC relative"
91-
default n if !CXX_EXCEPTION
92-
default y if CXX_EXCEPTION
91+
default CXX_EXCEPTION
9392
depends on LIBC_ARCH_ELF
9493
---help---
9594
Perform a PC relative relocation for relocation type R_ARM_TARGET2

arch/arm/src/armv7-r/Kconfig

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@ config ARMV7R_HAVE_PTM
3333

3434
config ARMV7R_MEMINIT
3535
bool
36-
default y if BOOT_SDRAM_DATA
37-
default n if !BOOT_SDRAM_DATA
36+
default BOOT_SDRAM_DATA
3837
---help---
3938
If this configuration *not* selected, then it is assumed that all
4039
memory resources are initialized via arm_data_initialize() and

arch/arm/src/armv8-m/Kconfig

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ config ARMV8M_HAVE_DCACHE
1515

1616
config ARMV8M_USEBASEPRI
1717
bool "Use BASEPRI Register"
18-
default y if ARCH_HIPRI_INTERRUPT
18+
default ARCH_HIPRI_INTERRUPT
1919
---help---
2020
Use the BASEPRI register to enable and disable interrupts. By
2121
default, the PRIMASK register is used for this purpose. This
@@ -69,8 +69,7 @@ config ARMV8M_DTCM
6969

7070
config ARMV8M_TARGET2_PREL
7171
bool "R_ARM_TARGET2 is PC relative"
72-
default n if !CXX_EXCEPTION
73-
default y if CXX_EXCEPTION
72+
default CXX_EXCEPTION
7473
depends on LIBC_ARCH_ELF
7574
---help---
7675
Perform a PC relative relocation for relocation type R_ARM_TARGET2

arch/arm/src/armv8-r/Kconfig

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ endif # ARMV8R_GIC_EOIMODE
2626

2727
config ARMV8R_MEMINIT
2828
bool
29-
default y if BOOT_SDRAM_DATA
30-
default n if !BOOT_SDRAM_DATA
29+
default BOOT_SDRAM_DATA
3130
---help---
3231
If this configuration *not* selected, then it is assumed that all
3332
memory resources are initialized via arm_data_initialize() and

arch/arm/src/cxd56xx/Kconfig

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,11 @@ config CXD56_XOSC_CLOCK
6868

6969
config CXD56_SPH
7070
bool
71-
default y if ASMP
71+
default ASMP
7272

7373
config CXD56_PMIC
7474
bool
75-
default y if CXD56_MAINCORE
76-
default n if CXD56_SUBCORE
75+
default CXD56_MAINCORE
7776

7877
if CXD56_PMIC
7978

@@ -106,8 +105,7 @@ config CXD56_CPUFIFO_NBUFFERS
106105

107106
config CXD56_FARAPI
108107
bool
109-
default y if CXD56_MAINCORE
110-
default n if CXD56_SUBCORE
108+
default CXD56_MAINCORE
111109

112110
menu "Far API Configuration"
113111
depends on CXD56_FARAPI
@@ -1164,8 +1162,7 @@ menu "Storage Options"
11641162

11651163
menuconfig CXD56_SFC
11661164
bool "SPI Flash"
1167-
default n if CXD56_SUBCORE
1168-
default y
1165+
default !CXD56_SUBCORE
11691166
select MTD
11701167

11711168
if CXD56_SFC
@@ -1256,7 +1253,7 @@ endif # SPISD Configuration
12561253

12571254
config CXD56_EMMC
12581255
bool "eMMC"
1259-
default n if CXD56_SUBCORE
1256+
default n
12601257
---help---
12611258
Emmc driver for cxd56xx chip
12621259

@@ -1377,8 +1374,7 @@ if CXD56_TESTSET
13771374

13781375
config CXD56_TESTSET_WITH_HWSEM
13791376
bool "Use custom testset based on hardware semaphore"
1380-
default n if CXD56_USE_SYSBUS
1381-
default y if !CXD56_USE_SYSBUS
1377+
default !CXD56_USE_SYSBUS
13821378

13831379
endif
13841380

arch/arm/src/cxd56xx/cxd56_emmc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -870,7 +870,7 @@ static ssize_t cxd56_emmc_read(struct inode *inode,
870870
DEBUGASSERT(inode && inode->i_private);
871871
priv = (struct cxd56_emmc_state_s *)inode->i_private;
872872

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

876876
ret = cxd56_emmc_readsectors(priv, buffer, start_sector, nsectors);

arch/arm/src/gd32f4/Kconfig

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -691,7 +691,7 @@ config ARCH_BOARD_GD32F4_CUSTOM_CLOCKCONFIG
691691

692692
config GD32F4_TCMEXCLUDE
693693
bool "Exclude TCM SRAM from the heap"
694-
default y if ARCH_DMA || LIBC_ARCH_ELF
694+
default ARCH_DMA || LIBC_ARCH_ELF
695695
depends on GD32F4_HAVE_TCM
696696
---help---
697697
Exclude TCM SRAM from the HEAP because it cannot be used for DMA
@@ -1192,8 +1192,7 @@ config GD32F4_ADC0_DMA
11921192
config GD32F4_ADC0_SCAN
11931193
bool "ADC0 scan mode"
11941194
depends on GD32F4_ADC0
1195-
default y if GD32F4_ADC0_DMA
1196-
default n
1195+
default GD32F4_ADC0_DMA
11971196

11981197
config GD32F4_ADC0_DMA_CFG
11991198
int "ADC0 DMA configuration"
@@ -1226,8 +1225,7 @@ config GD32F4_ADC1_DMA
12261225
config GD32F4_ADC1_SCAN
12271226
bool "ADC1 scan mode"
12281227
depends on GD32F4_ADC1
1229-
default y if GD32F4_ADC1_DMA
1230-
default n
1228+
default GD32F4_ADC1_DMA
12311229

12321230
config GD32F4_ADC1_DMA_CFG
12331231
int "ADC1 DMA configuration"
@@ -1260,8 +1258,7 @@ config GD32F4_ADC2_DMA
12601258
config GD32F4_ADC2_SCAN
12611259
bool "ADC2 scan mode"
12621260
depends on GD32F4_ADC2
1263-
default y if GD32F4_ADC2_DMA
1264-
default n
1261+
default GD32F4_ADC2_DMA
12651262

12661263
config GD32F4_ADC2_DMA_CFG
12671264
int "ADC2 DMA configuration"
@@ -2504,7 +2501,7 @@ config GD32F4_ENET_PTP
25042501

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

25672564
config GD32F4_USB_ITRMP
25682565
bool "Re-map USB interrupt"
2569-
default n if !GD32F4_CAN1
2570-
default y if GD32F4_CAN1
2566+
default GD32F4_CAN1
25712567
depends on GD32F4_USB && GD32F4_GD32F4XX
25722568
---help---
25732569
The legacy USB in the F1 series shared interrupt lines with USB

arch/arm/src/imx6/Kconfig

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,7 @@ config IMX_ENET_NTXBUFFERS
147147

148148
config IMX_ENET_ENHANCEDBD
149149
bool # not optional
150-
default n if ARMV7A_DCACHE_DISABLE
151-
default y if !ARMV7A_DCACHE_DISABLE
150+
default !ARMV7A_DCACHE_DISABLE
152151

153152
config IMX_ENET_NETHIFS
154153
int # Not optional

arch/arm/src/imxrt/Kconfig

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2191,8 +2191,7 @@ config IMXRT_ENET_NTXBUFFERS
21912191

21922192
config IMXRT_ENET_ENHANCEDBD
21932193
bool # not optional
2194-
default n if ARMV7M_DCACHE_WRITETHROUGH
2195-
default y if !ARMV7M_DCACHE_WRITETHROUGH
2194+
default !ARMV7M_DCACHE_WRITETHROUGH
21962195

21972196
config IMXRT_ENET_NETHIFS
21982197
int # Not optional

0 commit comments

Comments
 (0)