kernel: Kconfig: Remove redundant 'default n' properties

Bool symbols implicitly default to 'n'.

A 'default n' can make sense e.g. in a Kconfig.defconfig file, if you
want to override a 'default y' on the base definition of the symbol. It
isn't used like that on any of these symbols though.

Also simplify the definitions of COOP_ENABLED, PREEMPT_ENABLED, and
SYS_CLOCK_EXISTS. 'default' (and def_bool) can take any expression, not
just a fixed value.

(It would work without the parentheses around the comparisons too.)

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
This commit is contained in:
Ulf Magnusson 2018-06-22 02:25:43 +02:00 committed by Anas Nashif
commit 7727d1a48e
3 changed files with 3 additions and 39 deletions

View file

@ -86,14 +86,10 @@ config MAIN_THREAD_PRIORITY
of the main() function. main() can then change its priority if desired. of the main() function. main() can then change its priority if desired.
config COOP_ENABLED config COOP_ENABLED
bool def_bool (NUM_COOP_PRIORITIES != 0)
default y
default n if (NUM_COOP_PRIORITIES = 0)
config PREEMPT_ENABLED config PREEMPT_ENABLED
bool def_bool (NUM_PREEMPT_PRIORITIES != 0)
default y
default n if (NUM_PREEMPT_PRIORITIES = 0)
config PRIORITY_CEILING config PRIORITY_CEILING
int int
@ -125,7 +121,6 @@ config NUM_METAIRQ_PRIORITIES
config SCHED_DEADLINE config SCHED_DEADLINE
bool bool
prompt "Enable earliest-deadline-first scheduling" prompt "Enable earliest-deadline-first scheduling"
default n
help help
This enables a simple "earliest deadline first" scheduling This enables a simple "earliest deadline first" scheduling
mode where threads can set "deadline" deltas measured in mode where threads can set "deadline" deltas measured in
@ -170,7 +165,6 @@ config ISR_STACK_SIZE
config THREAD_STACK_INFO config THREAD_STACK_INFO
bool bool
prompt "Thread stack info" prompt "Thread stack info"
default n
help help
This option allows each thread to store the thread stack info into This option allows each thread to store the thread stack info into
the k_thread data structure. the k_thread data structure.
@ -178,7 +172,6 @@ config THREAD_STACK_INFO
config THREAD_CUSTOM_DATA config THREAD_CUSTOM_DATA
bool bool
prompt "Thread custom data" prompt "Thread custom data"
default n
help help
This option allows each thread to store 32 bits of custom data, This option allows each thread to store 32 bits of custom data,
which can be accessed using the k_thread_custom_data_xxx() APIs. which can be accessed using the k_thread_custom_data_xxx() APIs.
@ -196,7 +189,6 @@ config ERRNO
config APPLICATION_MEMORY config APPLICATION_MEMORY
bool bool
prompt "Split kernel and application memory" prompt "Split kernel and application memory"
default n
help help
For all read-write memory sections (namely bss, noinit, data), For all read-write memory sections (namely bss, noinit, data),
separate them into application and kernel areas. The application area separate them into application and kernel areas. The application area
@ -206,7 +198,6 @@ config APPLICATION_MEMORY
config WAITQ_FAST config WAITQ_FAST
bool bool
prompt "Use scalable wait_q implementation" prompt "Use scalable wait_q implementation"
default n
help help
When selected, the wait_q abstraction used in IPC primitives When selected, the wait_q abstraction used in IPC primitives
to pend threads for wakeup later will be implemented with a to pend threads for wakeup later will be implemented with a
@ -236,7 +227,6 @@ menu "Kernel Debugging and Metrics"
config INIT_STACKS config INIT_STACKS
bool bool
prompt "Initialize stack areas" prompt "Initialize stack areas"
default n
help help
This option instructs the kernel to initialize stack areas with a This option instructs the kernel to initialize stack areas with a
known value (0xaa) before they are first used, so that the high known value (0xaa) before they are first used, so that the high
@ -246,7 +236,6 @@ config INIT_STACKS
config KERNEL_DEBUG config KERNEL_DEBUG
bool bool
prompt "Kernel debugging" prompt "Kernel debugging"
default n
select INIT_STACKS select INIT_STACKS
help help
Enable kernel debugging. Enable kernel debugging.
@ -281,7 +270,6 @@ config BOOT_DELAY
config BUILD_TIMESTAMP config BUILD_TIMESTAMP
bool bool
default n
prompt "Build Timestamp" prompt "Build Timestamp"
help help
Record a timestamp from the build and add it to the boot banner. Record a timestamp from the build and add it to the boot banner.
@ -291,7 +279,6 @@ config BUILD_TIMESTAMP
config INT_LATENCY_BENCHMARK config INT_LATENCY_BENCHMARK
bool bool
prompt "Interrupt latency metrics [EXPERIMENTAL]" prompt "Interrupt latency metrics [EXPERIMENTAL]"
default n
depends on ARCH="x86" depends on ARCH="x86"
help help
This option enables the tracking of interrupt latency metrics; This option enables the tracking of interrupt latency metrics;
@ -303,7 +290,6 @@ config INT_LATENCY_BENCHMARK
config EXECUTION_BENCHMARKING config EXECUTION_BENCHMARKING
bool bool
prompt "Timing metrics" prompt "Timing metrics"
default n
help help
This option enables the tracking of various times inside the kernel This option enables the tracking of various times inside the kernel
the exact set of metrics being tracked is board-dependent. the exact set of metrics being tracked is board-dependent.
@ -313,7 +299,6 @@ config EXECUTION_BENCHMARKING
config THREAD_MONITOR config THREAD_MONITOR
bool bool
prompt "Thread monitoring [EXPERIMENTAL]" prompt "Thread monitoring [EXPERIMENTAL]"
default n
help help
This option instructs the kernel to maintain a list of all threads This option instructs the kernel to maintain a list of all threads
(excluding those that have not yet started or have already (excluding those that have not yet started or have already
@ -403,7 +388,6 @@ config TIMESLICE_PRIORITY
config POLL config POLL
bool bool
prompt "Async I/O Framework" prompt "Async I/O Framework"
default n
help help
Asynchronous notification framework. Enable the k_poll() and Asynchronous notification framework. Enable the k_poll() and
k_poll_signal() APIs. The former can wait on multiple events k_poll_signal() APIs. The former can wait on multiple events
@ -451,7 +435,6 @@ endmenu
config ARCH_HAS_CUSTOM_SWAP_TO_MAIN config ARCH_HAS_CUSTOM_SWAP_TO_MAIN
bool bool
# hidden # hidden
default n
help help
It's possible that an architecture port cannot use _Swap() to swap to It's possible that an architecture port cannot use _Swap() to swap to
the _main() thread, but instead must do something custom. It must the _main() thread, but instead must do something custom. It must
@ -460,7 +443,6 @@ config ARCH_HAS_CUSTOM_SWAP_TO_MAIN
config ARCH_HAS_CUSTOM_BUSY_WAIT config ARCH_HAS_CUSTOM_BUSY_WAIT
bool bool
# hidden # hidden
default n
help help
It's possible that an architecture port cannot or does not want to use It's possible that an architecture port cannot or does not want to use
the provided k_busy_wait(), but instead must do something custom. It must the provided k_busy_wait(), but instead must do something custom. It must
@ -500,10 +482,8 @@ config SYS_CLOCK_HW_CYCLES_PER_SEC
and the user should generally avoid modifying it via the menu configuration. and the user should generally avoid modifying it via the menu configuration.
config SYS_CLOCK_EXISTS config SYS_CLOCK_EXISTS
bool def_bool (SYS_CLOCK_TICKS_PER_SEC != 0)
# omit prompt to signify a "hidden" option # omit prompt to signify a "hidden" option
default y
default n if (SYS_CLOCK_TICKS_PER_SEC = 0)
help help
This option specifies that the kernel lacks timer support. This option specifies that the kernel lacks timer support.
@ -573,7 +553,6 @@ config RETPOLINE
config STACK_CANARIES config STACK_CANARIES
bool bool
prompt "Compiler stack canaries" prompt "Compiler stack canaries"
default n
help help
This option enables compiler stack canaries support kernel functions. This option enables compiler stack canaries support kernel functions.
@ -636,7 +615,6 @@ menu "SMP Options"
config USE_SWITCH config USE_SWITCH
bool bool
prompt "Use new-style _arch_switch instead of __swap" prompt "Use new-style _arch_switch instead of __swap"
default n
help help
The _arch_switch() API is a lower level context switching The _arch_switch() API is a lower level context switching
primitive than the original __swap mechanism. It is required primitive than the original __swap mechanism. It is required
@ -648,7 +626,6 @@ config USE_SWITCH
config SMP config SMP
bool bool
prompt "Enable symmetric multithreading support" prompt "Enable symmetric multithreading support"
default n
help help
When true, kernel will be built with SMP support, allowing When true, kernel will be built with SMP support, allowing
more than one CPU to schedule Zephyr tasks at a time. more than one CPU to schedule Zephyr tasks at a time.

View file

@ -7,7 +7,6 @@
menuconfig KERNEL_EVENT_LOGGER menuconfig KERNEL_EVENT_LOGGER
bool bool
prompt "Enable kernel event logger features" prompt "Enable kernel event logger features"
default n
select RING_BUFFER select RING_BUFFER
help help
This feature enables the usage of the profiling logger. Provides the This feature enables the usage of the profiling logger. Provides the
@ -26,7 +25,6 @@ config KERNEL_EVENT_LOGGER_BUFFER_SIZE
config KERNEL_EVENT_LOGGER_DYNAMIC config KERNEL_EVENT_LOGGER_DYNAMIC
bool bool
prompt "Kernel event logger dynamic enabling" prompt "Kernel event logger dynamic enabling"
default n
help help
If enabled, kernel event logger is not logging any data to the ring buffer If enabled, kernel event logger is not logging any data to the ring buffer
It is up to the application to set the appropriate flags to enable/disable the It is up to the application to set the appropriate flags to enable/disable the
@ -35,7 +33,6 @@ config KERNEL_EVENT_LOGGER_DYNAMIC
config KERNEL_EVENT_LOGGER_CUSTOM_TIMESTAMP config KERNEL_EVENT_LOGGER_CUSTOM_TIMESTAMP
bool bool
prompt "Kernel event logger custom timestamp" prompt "Kernel event logger custom timestamp"
default n
help help
This flag enables the possibility to set the timer function to be used to This flag enables the possibility to set the timer function to be used to
populate kernel event logger timestamp. This has to be done at runtime by populate kernel event logger timestamp. This has to be done at runtime by
@ -46,14 +43,12 @@ menu "Kernel event logging points"
config KERNEL_EVENT_LOGGER_CONTEXT_SWITCH config KERNEL_EVENT_LOGGER_CONTEXT_SWITCH
bool bool
prompt "Context switch event logging point" prompt "Context switch event logging point"
default n
help help
Enable the context switch event messages. Enable the context switch event messages.
config KERNEL_EVENT_LOGGER_INTERRUPT config KERNEL_EVENT_LOGGER_INTERRUPT
bool bool
prompt "Interrupt event logging point" prompt "Interrupt event logging point"
default n
help help
Enable interrupt event messages. These messages provide the following Enable interrupt event messages. These messages provide the following
information: The time when interrupts occur. information: The time when interrupts occur.
@ -61,7 +56,6 @@ config KERNEL_EVENT_LOGGER_INTERRUPT
config KERNEL_EVENT_LOGGER_SLEEP config KERNEL_EVENT_LOGGER_SLEEP
bool bool
prompt "Sleep event logging point" prompt "Sleep event logging point"
default n
depends on SYS_POWER_MANAGEMENT depends on SYS_POWER_MANAGEMENT
help help
Enable low power condition event messages. These messages provide the Enable low power condition event messages. These messages provide the
@ -74,7 +68,6 @@ config KERNEL_EVENT_LOGGER_SLEEP
config KERNEL_EVENT_LOGGER_THREAD config KERNEL_EVENT_LOGGER_THREAD
bool bool
prompt "Thread event logging point" prompt "Thread event logging point"
default n
help help
Enable thread event messages. These messages provide the following Enable thread event messages. These messages provide the following
information: information:

View file

@ -8,7 +8,6 @@
menuconfig SYS_POWER_MANAGEMENT menuconfig SYS_POWER_MANAGEMENT
bool bool
prompt "Power management" prompt "Power management"
default n
help help
This option enables the board to implement extra power management This option enables the board to implement extra power management
policies whenever the kernel becomes idle. The kernel informs the policies whenever the kernel becomes idle. The kernel informs the
@ -19,7 +18,6 @@ if SYS_POWER_MANAGEMENT
config SYS_POWER_LOW_POWER_STATE config SYS_POWER_LOW_POWER_STATE
bool bool
prompt "Low power state" prompt "Low power state"
default n
depends on SYS_POWER_LOW_POWER_STATE_SUPPORTED depends on SYS_POWER_LOW_POWER_STATE_SUPPORTED
help help
This option enables the kernel to interface with a power manager This option enables the kernel to interface with a power manager
@ -31,7 +29,6 @@ config SYS_POWER_LOW_POWER_STATE
config SYS_POWER_DEEP_SLEEP config SYS_POWER_DEEP_SLEEP
bool bool
prompt "Deep sleep state" prompt "Deep sleep state"
default n
depends on SYS_POWER_DEEP_SLEEP_SUPPORTED depends on SYS_POWER_DEEP_SLEEP_SUPPORTED
help help
This option enables the kernel to interface with a power manager This option enables the kernel to interface with a power manager
@ -45,7 +42,6 @@ config SYS_POWER_DEEP_SLEEP
config DEVICE_POWER_MANAGEMENT config DEVICE_POWER_MANAGEMENT
bool bool
prompt "Device power management" prompt "Device power management"
default n
help help
This option enables the device power management interface. The This option enables the device power management interface. The
interface consists of hook functions implemented by device drivers interface consists of hook functions implemented by device drivers
@ -79,7 +75,6 @@ config TICKLESS_IDLE_THRESH
config TICKLESS_KERNEL config TICKLESS_KERNEL
bool bool
prompt "Tickless kernel" prompt "Tickless kernel"
default n
depends on TICKLESS_IDLE depends on TICKLESS_IDLE
help help
This option enables a fully event driven kernel. Periodic system This option enables a fully event driven kernel. Periodic system
@ -102,7 +97,6 @@ config TICKLESS_KERNEL_TIME_UNIT_IN_MICRO_SECS
config BUSY_WAIT_USES_ALTERNATE_CLOCK config BUSY_WAIT_USES_ALTERNATE_CLOCK
bool bool
prompt "Busy wait uses alternate clock in tickless kernel mode" prompt "Busy wait uses alternate clock in tickless kernel mode"
default n
help help
In tickless kernel mode, the system clock will be stopped when In tickless kernel mode, the system clock will be stopped when
there are no timer events programmed. If the system clock is to there are no timer events programmed. If the system clock is to