Skip to content

Commit

Permalink
kconfig: replace known integer constants with variables
Browse files Browse the repository at this point in the history
Make the intent of the value clear and avoid invalid ranges with typos.

Signed-off-by: Pieter De Gendt <[email protected]>
  • Loading branch information
pdgendt committed Jul 5, 2024
1 parent 7b97c09 commit 2550fd9
Show file tree
Hide file tree
Showing 97 changed files with 215 additions and 215 deletions.
2 changes: 1 addition & 1 deletion arch/arm/core/cortex_m/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ config ZERO_LATENCY_IRQS
config ZERO_LATENCY_LEVELS
int "Number of interrupt priority levels reserved for zero latency"
depends on ZERO_LATENCY_IRQS
range 1 255
range 1 $(UINT8_MAX)
help
The amount of interrupt priority levels reserved for zero latency
interrupts. Increase this value to reserve more than one priority
Expand Down
2 changes: 1 addition & 1 deletion arch/x86/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ config MAX_IRQ_LINES
config IRQ_OFFLOAD_VECTOR
int "IDT vector to use for IRQ offload"
default 33
range 32 255
range 32 $(UINT8_MAX)
depends on IRQ_OFFLOAD

config PIC_DISABLE
Expand Down
4 changes: 2 additions & 2 deletions arch/x86/core/Kconfig.intel64
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ config X86_EXCEPTION_STACK_TRACE
config SCHED_IPI_VECTOR
int "IDT vector to use for scheduler IPI"
default 34
range 33 255
range 33 $(UINT8_MAX)
depends on SMP

config TLB_IPI_VECTOR
int "IDT vector to use for TLB shootdown IPI"
default 35
range 33 255
range 33 $(UINT8_MAX)
depends on SMP

# We should really only have to provide one of the following two values,
Expand Down
4 changes: 2 additions & 2 deletions boards/ambiq/apollo4p_blue_kxr_evb/Kconfig.defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ config BT_BUF_ACL_TX_COUNT
default 14

config BT_BUF_CMD_TX_SIZE
default 255
default $(UINT8_MAX)

config BT_BUF_EVT_RX_SIZE
default 255
default $(UINT8_MAX)

config BT_BUF_ACL_TX_SIZE
default 251
Expand Down
2 changes: 1 addition & 1 deletion boards/espressif/esp32_devkitc_wroom/Kconfig.defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ if BOARD_ESP32_DEVKITC_WROOM_ESP32_PROCPU

config HEAP_MEM_POOL_ADD_SIZE_BOARD
int
default 65535 if WIFI && BT
default $(UINT16_MAX) if WIFI && BT
default 51200 if WIFI
default 40960 if BT
default 4096
Expand Down
2 changes: 1 addition & 1 deletion boards/espressif/esp32_devkitc_wrover/Kconfig.defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ if BOARD_ESP32_DEVKITC_WROVER_ESP32_PROCPU

config HEAP_MEM_POOL_ADD_SIZE_BOARD
int
default 65535 if WIFI && BT
default $(UINT16_MAX) if WIFI && BT
default 51200 if WIFI
default 40960 if BT
default 4096
Expand Down
2 changes: 1 addition & 1 deletion boards/espressif/esp32_ethernet_kit/Kconfig.defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ endchoice

config HEAP_MEM_POOL_ADD_SIZE_BOARD
int
default 65535 if WIFI && BT
default $(UINT16_MAX) if WIFI && BT
default 51200 if WIFI
default 40960 if BT
default 4096
Expand Down
2 changes: 1 addition & 1 deletion boards/espressif/esp32c3_devkitm/Kconfig.defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

config HEAP_MEM_POOL_ADD_SIZE_BOARD
int
default 65535 if WIFI && BT
default $(UINT16_MAX) if WIFI && BT
default 51200 if WIFI
default 40960 if BT
default 4096
2 changes: 1 addition & 1 deletion boards/espressif/esp32c6_devkitc/Kconfig.defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

config HEAP_MEM_POOL_ADD_SIZE_BOARD
int
default 65535 if WIFI && BT
default $(UINT16_MAX) if WIFI && BT
default 51200 if WIFI
default 40960 if BT
default 4096
2 changes: 1 addition & 1 deletion boards/espressif/esp32s3_devkitc/Kconfig.defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ if BOARD_ESP32S3_DEVKITC_ESP32S3_PROCPU

config HEAP_MEM_POOL_ADD_SIZE_BOARD
int
default 65535 if WIFI && BT
default $(UINT16_MAX) if WIFI && BT
default 51200 if WIFI
default 40960 if BT
default 4096
Expand Down
2 changes: 1 addition & 1 deletion boards/espressif/esp32s3_devkitm/Kconfig.defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ if BOARD_ESP32S3_DEVKITM_ESP32S3_PROCPU

config HEAP_MEM_POOL_ADD_SIZE_BOARD
int
default 65535 if WIFI && BT
default $(UINT16_MAX) if WIFI && BT
default 51200 if WIFI
default 40960 if BT
default 4096
Expand Down
2 changes: 1 addition & 1 deletion boards/espressif/esp_wrover_kit/Kconfig.defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ if BOARD_ESP_WROVER_KIT_ESP32_PROCPU

config HEAP_MEM_POOL_ADD_SIZE_BOARD
int
default 65535 if WIFI && BT
default $(UINT16_MAX) if WIFI && BT
default 51200 if WIFI
default 40960 if BT
default 4096
Expand Down
2 changes: 1 addition & 1 deletion boards/hardkernel/odroid_go/Kconfig.defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ endchoice

config HEAP_MEM_POOL_ADD_SIZE_BOARD
int
default 65535 if WIFI && BT
default $(UINT16_MAX) if WIFI && BT
default 51200 if WIFI
default 40960 if BT
default 4096
Expand Down
2 changes: 1 addition & 1 deletion boards/heltec/heltec_wifi_lora32_v2/Kconfig.defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ if BOARD_HELTEC_WIFI_LORA32_V2_ESP32_PROCPU

config HEAP_MEM_POOL_ADD_SIZE_BOARD
int
default 65535 if WIFI && BT
default $(UINT16_MAX) if WIFI && BT
default 51200 if WIFI
default 40960 if BT
default 4096
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ if BOARD_HELTEC_WIRELESS_STICK_LITE_V3_ESP32S3_PROCPU

config HEAP_MEM_POOL_ADD_SIZE_BOARD
int
default 65535 if WIFI && BT
default $(UINT16_MAX) if WIFI && BT
default 51200 if WIFI
default 40960 if BT
default 4096
Expand Down
2 changes: 1 addition & 1 deletion boards/kincony/kincony_kc868_a32/Kconfig.defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ if BOARD_KINCONY_KC868_A32_ESP32_PROCPU

config HEAP_MEM_POOL_ADD_SIZE_BOARD
int
default 65535 if WIFI && BT
default $(UINT16_MAX) if WIFI && BT
default 51200 if WIFI
default 40960 if BT
default 4096
Expand Down
2 changes: 1 addition & 1 deletion boards/lilygo/ttgo_lora32/Kconfig.defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ config ENTROPY_GENERATOR

config HEAP_MEM_POOL_ADD_SIZE_BOARD
int
default 65535 if WIFI && BT
default $(UINT16_MAX) if WIFI && BT
default 51200 if WIFI
default 40960 if BT
default 4096
Expand Down
2 changes: 1 addition & 1 deletion boards/lilygo/ttgo_t8c3/Kconfig.defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

config HEAP_MEM_POOL_ADD_SIZE_BOARD
int
default 65535 if WIFI && BT
default $(UINT16_MAX) if WIFI && BT
default 51200 if WIFI
default 40960 if BT
default 4096
2 changes: 1 addition & 1 deletion boards/luatos/esp32c3_luatos_core/Kconfig.defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

config HEAP_MEM_POOL_ADD_SIZE_BOARD
int
default 65535 if WIFI && BT
default $(UINT16_MAX) if WIFI && BT
default 51200 if WIFI
default 40960 if BT
default 4096
2 changes: 1 addition & 1 deletion boards/luatos/esp32s3_luatos_core/Kconfig.defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ if BOARD_ESP32S3_LUATOS_CORE_ESP32S3_PROCPU || BOARD_ESP32S3_LUATOS_CORE_ESP32S3

config HEAP_MEM_POOL_ADD_SIZE_BOARD
int
default 65535 if WIFI && BT
default $(UINT16_MAX) if WIFI && BT
default 51200 if WIFI
default 40960 if BT
default 4096
Expand Down
2 changes: 1 addition & 1 deletion boards/m5stack/m5stack_atom_lite/Kconfig.defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ if BOARD_M5STACK_ATOM_LITE_ESP32_PROCPU

config HEAP_MEM_POOL_ADD_SIZE_BOARD
int
default 65535 if WIFI && BT
default $(UINT16_MAX) if WIFI && BT
default 51200 if WIFI
default 40960 if BT
default 4096
Expand Down
2 changes: 1 addition & 1 deletion boards/m5stack/m5stack_atoms3/Kconfig.defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ config LV_COLOR_16_SWAP

config HEAP_MEM_POOL_ADD_SIZE_BOARD
int
default 65535 if WIFI && BT
default $(UINT16_MAX) if WIFI && BT
default 51200 if WIFI
default 40960 if BT
default 4096
Expand Down
2 changes: 1 addition & 1 deletion boards/m5stack/m5stack_atoms3_lite/Kconfig.defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ if BOARD_M5STACK_ATOMS3_LITE_ESP32S3_PROCPU

config HEAP_MEM_POOL_ADD_SIZE_BOARD
int
default 65535 if WIFI && BT
default $(UINT16_MAX) if WIFI && BT
default 51200 if WIFI
default 40960 if BT
default 4096
Expand Down
2 changes: 1 addition & 1 deletion boards/m5stack/m5stack_core2/Kconfig.defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ if BOARD_M5STACK_CORE2_ESP32_PROCPU

config HEAP_MEM_POOL_ADD_SIZE_BOARD
int
default 65535 if WIFI && BT
default $(UINT16_MAX) if WIFI && BT
default 51200 if WIFI
default 65536 if BT
default 4096
Expand Down
2 changes: 1 addition & 1 deletion boards/m5stack/m5stack_stamps3/Kconfig.defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ if BOARD_M5STACK_STAMPS3_ESP32S3_PROCPU

config HEAP_MEM_POOL_ADD_SIZE_BOARD
int
default 65535 if WIFI && BT
default $(UINT16_MAX) if WIFI && BT
default 51200 if WIFI
default 40960 if BT
default 4096
Expand Down
2 changes: 1 addition & 1 deletion boards/m5stack/m5stickc_plus/Kconfig.defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ if BOARD_M5STICKC_PLUS_ESP32_PROCPU

config HEAP_MEM_POOL_ADD_SIZE_BOARD
int
default 65535 if WIFI && BT
default $(UINT16_MAX) if WIFI && BT
default 51200 if WIFI
default 40960 if BT
default 4096
Expand Down
2 changes: 1 addition & 1 deletion boards/m5stack/stamp_c3/Kconfig.defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

config HEAP_MEM_POOL_ADD_SIZE_BOARD
int
default 65535 if WIFI && BT
default $(UINT16_MAX) if WIFI && BT
default 51200 if WIFI
default 40960 if BT
default 4096
2 changes: 1 addition & 1 deletion boards/olimex/olimex_esp32_evb/Kconfig.defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ if BOARD_OLIMEX_ESP32_EVB_ESP32_PROCPU

config HEAP_MEM_POOL_ADD_SIZE_BOARD
int
default 65535 if WIFI && BT
default $(UINT16_MAX) if WIFI && BT
default 51200 if WIFI
default 40960 if BT
default 4096
Expand Down
2 changes: 1 addition & 1 deletion boards/others/icev_wireless/Kconfig.defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

config HEAP_MEM_POOL_ADD_SIZE_BOARD
int
default 65535 if WIFI && BT
default $(UINT16_MAX) if WIFI && BT
default 51200 if WIFI
default 40960 if BT
default 4096
2 changes: 1 addition & 1 deletion boards/seeed/xiao_esp32c3/Kconfig.defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

config HEAP_MEM_POOL_ADD_SIZE_BOARD
int
default 65535 if WIFI && BT
default $(UINT16_MAX) if WIFI && BT
default 51200 if WIFI
default 40960 if BT
default 4096
2 changes: 1 addition & 1 deletion boards/seeed/xiao_esp32s3/Kconfig.defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ if BOARD_XIAO_ESP32S3_ESP32S3_PROCPU

config HEAP_MEM_POOL_ADD_SIZE_BOARD
int
default 65535 if WIFI && BT
default $(UINT16_MAX) if WIFI && BT
default 51200 if WIFI
default 40960 if BT
default 4096
Expand Down
2 changes: 1 addition & 1 deletion boards/vcc-gnd/yd_esp32/Kconfig.defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ if BOARD_YD_ESP32_ESP32_PROCPU

config HEAP_MEM_POOL_ADD_SIZE_BOARD
int
default 65535 if WIFI && BT
default $(UINT16_MAX) if WIFI && BT
default 51200 if WIFI
default 40960 if BT
default 4096
Expand Down
2 changes: 1 addition & 1 deletion boards/waveshare/esp32s3_touch_lcd_1_28/Kconfig.defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ if BOARD_ESP32S3_TOUCH_LCD_1_28_ESP32S3_PROCPU

config HEAP_MEM_POOL_ADD_SIZE_BOARD
int
default 65535 if WIFI && BT
default $(UINT16_MAX) if WIFI && BT
default 51200 if WIFI
default 40960 if BT
default 4096
Expand Down
2 changes: 1 addition & 1 deletion drivers/bluetooth/hci/Kconfig.infineon
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ config AIROC_CUSTOM_FIRMWARE_HCD_BLOB
# Change size of command lengths. It for vendor commands related to
# firmware downloading.
config BT_BUF_CMD_TX_SIZE
default 255
default $(UINT8_MAX)

endif # BT_AIROC

Expand Down
2 changes: 1 addition & 1 deletion drivers/clock_control/Kconfig.nrf
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ config CLOCK_CONTROL_NRF_CALIBRATION_PERIOD
config CLOCK_CONTROL_NRF_CALIBRATION_MAX_SKIP
int "Maximum number of calibration skips"
default 1
range 0 255
range 0 $(UINT8_MAX)
help
Calibration is skipped when temperature change since last calibration
was less than configured threshold. If number of consecutive skips
Expand Down
2 changes: 1 addition & 1 deletion drivers/display/Kconfig.microbit
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ config MICROBIT_DISPLAY

config MICROBIT_DISPLAY_STR_MAX
int "Maximum length of strings that can be shown on the display"
range 3 255
range 3 $(UINT8_MAX)
default 40
depends on MICROBIT_DISPLAY
help
Expand Down
2 changes: 1 addition & 1 deletion drivers/display/Kconfig.ssd1306
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ if SSD1306
config SSD1306_DEFAULT_CONTRAST
int "SSD1306 default contrast"
default 128
range 0 255
range 0 $(UINT8_MAX)
help
SSD1306 default contrast.

Expand Down
4 changes: 2 additions & 2 deletions drivers/entropy/Kconfig.cc13xx_cc26xx
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ config ENTROPY_CC13XX_CC26XX_SAMPLES_PER_CYCLE

config ENTROPY_CC13XX_CC26XX_ALARM_THRESHOLD
int "Threshold for detected repeated patterns"
range 0 255
default 255
range 0 $(UINT8_MAX)
default $(UINT8_MAX)
help
The number of samples detected with repeating patterns before an alarm
event is triggered. The associated FRO is automatically shut down.
Expand Down
4 changes: 2 additions & 2 deletions drivers/entropy/Kconfig.nrf5
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ config ENTROPY_NRF5_THR_POOL_SIZE

config ENTROPY_NRF5_THR_THRESHOLD
int "Thread-mode random number pool low-water threshold"
range 4 255
range 4 $(UINT8_MAX)
help
Low water-mark threshold in bytes to trigger entropy generation for
thread mode consumers. As soon as the number of available bytes in the
Expand All @@ -60,7 +60,7 @@ config ENTROPY_NRF5_ISR_POOL_SIZE

config ENTROPY_NRF5_ISR_THRESHOLD
int "ISR-mode random number pool low-water threshold"
range 12 255
range 12 $(UINT8_MAX)
help
Low water-mark threshold in bytes to trigger entropy generation for
ISR consumers. As soon as the number of available bytes in the
Expand Down
4 changes: 2 additions & 2 deletions drivers/entropy/Kconfig.smartbond
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ config ENTROPY_SMARTBOND_THR_POOL_SIZE

config ENTROPY_SMARTBOND_THR_THRESHOLD
int "Thread-mode random number pool low-water threshold"
range 4 255
range 4 $(UINT8_MAX)
help
Low water-mark threshold in bytes to trigger entropy generation for
thread mode consumers. As soon as the number of available bytes in the
Expand All @@ -43,7 +43,7 @@ config ENTROPY_SMARTBOND_ISR_POOL_SIZE

config ENTROPY_SMARTBOND_ISR_THRESHOLD
int "ISR-mode random number pool low-water threshold"
range 12 255
range 12 $(UINT8_MAX)
help
Low water-mark threshold in bytes to trigger entropy generation for
ISR consumers. As soon as the number of available bytes in the
Expand Down
Loading

0 comments on commit 2550fd9

Please sign in to comment.