kconfig: Remove some redundant single-item menus and ifs

A single menu within an if like

    if FOO

    menu "blah"

    ...

    endmenu

    endif

can be replaced with

    menu "blah"
            depends on FOO

    ...

    endmenu

Fix up all existing instances.

Also remove redundant extra menus underneath 'menuconfig' symbols.
'menuconfig' already creates a menu.

Also remove the menu in arch/arm/core/aarch32/Kconfig around the
"Floating point ABI" choice. The choice depends on FLOAT, which depends
on CPU_HAS_CPU, so remove the 'depends on CPU_HAS_FPU' too.

Piggyback removing a redundant 'default n' for BME280.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
This commit is contained in:
Ulf Magnusson 2019-12-21 07:00:23 +01:00 committed by Anas Nashif
commit 6ef29c0250
8 changed files with 3 additions and 34 deletions

View file

@ -246,9 +246,6 @@ config ARM_ENTRY_VENEERS_LIB_NAME
endmenu endmenu
menu "Architecture Floating Point Options"
depends on CPU_HAS_FPU
choice choice
prompt "Floating point ABI" prompt "Floating point ABI"
default FP_HARDABI default FP_HARDABI
@ -269,8 +266,6 @@ config FP_SOFTABI
endchoice endchoice
endmenu
source "arch/arm/core/aarch32/cortex_m/Kconfig" source "arch/arm/core/aarch32/cortex_m/Kconfig"
source "arch/arm/core/aarch32/cortex_r/Kconfig" source "arch/arm/core/aarch32/cortex_r/Kconfig"

View file

@ -9,9 +9,8 @@
# Controller support is an HCI driver in itself, so these HCI driver # Controller support is an HCI driver in itself, so these HCI driver
# options are only applicable if controller support hasn't been enabled. # options are only applicable if controller support hasn't been enabled.
if BT && ! BT_CTLR
menu "Bluetooth Drivers" menu "Bluetooth Drivers"
depends on BT && !BT_CTLR
if BT_HCI if BT_HCI
source "drivers/bluetooth/hci/Kconfig" source "drivers/bluetooth/hci/Kconfig"
@ -22,5 +21,3 @@ if BT_CUSTOM
endif endif
endmenu endmenu
endif # BT && ! BT_CTLR

View file

@ -7,14 +7,11 @@
menuconfig BME280 menuconfig BME280
bool "BME280/BMP280 sensor" bool "BME280/BMP280 sensor"
depends on I2C || SPI depends on I2C || SPI
default n
help help
Enable driver for BME280 I2C-based or SPI-based temperature and pressure sensor. Enable driver for BME280 I2C-based or SPI-based temperature and pressure sensor.
if BME280 if BME280
menu "Attributes"
choice choice
prompt "BME280 temperature oversampling" prompt "BME280 temperature oversampling"
default BME280_TEMP_OVER_2X default BME280_TEMP_OVER_2X
@ -110,6 +107,4 @@ config BME280_FILTER_16
bool "16" bool "16"
endchoice endchoice
endmenu
endif # BME280 endif # BME280

View file

@ -11,8 +11,6 @@ menuconfig BME680
if BME680 if BME680
menu "BME680 Attributes"
choice choice
prompt "BME680 temperature oversampling" prompt "BME680 temperature oversampling"
default BME680_TEMP_OVER_2X default BME680_TEMP_OVER_2X
@ -112,6 +110,4 @@ config BME680_HEATR_DUR_ULP
bool "1943" bool "1943"
endchoice endchoice
endmenu # BME680 Attributes
endif # BME680 endif # BME680

View file

@ -10,8 +10,6 @@ menuconfig LPS22HB
if LPS22HB if LPS22HB
menu "Attributes"
config LPS22HB_SAMPLING_RATE config LPS22HB_SAMPLING_RATE
int "Output data rate" int "Output data rate"
default 25 default 25
@ -19,6 +17,4 @@ config LPS22HB_SAMPLING_RATE
Sensor output data rate expressed in samples per second. Sensor output data rate expressed in samples per second.
Data rates supported by the chip are 1, 10, 25, 50, 75. Data rates supported by the chip are 1, 10, 25, 50, 75.
endmenu
endif # LPS22HB endif # LPS22HB

View file

@ -10,8 +10,6 @@ menuconfig LPS25HB
if LPS25HB if LPS25HB
menu "Attributes"
config LPS25HB_SAMPLING_RATE config LPS25HB_SAMPLING_RATE
int "Output data rate" int "Output data rate"
default 25 default 25
@ -19,6 +17,4 @@ config LPS25HB_SAMPLING_RATE
Sensor output data rate expressed in samples per second. Sensor output data rate expressed in samples per second.
Data rates supported by the chip are 1, 7, 13, 25. Data rates supported by the chip are 1, 7, 13, 25.
endmenu
endif # LPS25HB endif # LPS25HB

View file

@ -4,9 +4,8 @@
# Copyright (c) 2018 Nordic Semiconductor ASA # Copyright (c) 2018 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
if MBEDTLS
menu "TLS configuration" menu "TLS configuration"
depends on MBEDTLS
menu "Supported TLS version" menu "Supported TLS version"
@ -325,5 +324,3 @@ config MBEDTLS_USER_CONFIG_FILE
covered by the generic config file. covered by the generic config file.
endmenu endmenu
endif # MBEDTLS

View file

@ -3,9 +3,8 @@
# Copyright (c) 2018 Nordic Semiconductor ASA # Copyright (c) 2018 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
if BT_CONN
menu "GATT Services" menu "GATT Services"
depends on BT_CONN
source "subsys/bluetooth/services/Kconfig.dis" source "subsys/bluetooth/services/Kconfig.dis"
@ -14,5 +13,3 @@ source "subsys/bluetooth/services/Kconfig.bas"
source "subsys/bluetooth/services/Kconfig.hrs" source "subsys/bluetooth/services/Kconfig.hrs"
endmenu endmenu
endif # BT_CONN