You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by ar...@apache.org on 2023/07/25 01:51:15 UTC

[nuttx-apps] 02/02: Kconfig: Simplify the conditional default statement

This is an automated email from the ASF dual-hosted git repository.

archer pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git

commit 8083b094c3a7d3a66c9daebe12fa94ef24489a7e
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Sun Jul 16 01:21:32 2023 +0800

    Kconfig: Simplify the conditional default statement
    
    Signed-off-by: Xiang Xiao <xi...@xiaomi.com>
---
 examples/foc/Kconfig        | 9 +++------
 examples/mld/Kconfig        | 3 +--
 examples/nettest/Kconfig    | 3 +--
 examples/tcpblaster/Kconfig | 3 +--
 examples/udp/Kconfig        | 3 +--
 examples/udpblaster/Kconfig | 3 +--
 graphics/nxwidgets/Kconfig  | 3 +--
 graphics/nxwm/Kconfig       | 6 ++----
 netutils/webserver/Kconfig  | 9 +++------
 nshlib/Kconfig              | 3 +--
 10 files changed, 15 insertions(+), 30 deletions(-)

diff --git a/examples/foc/Kconfig b/examples/foc/Kconfig
index bb9dc9422..e5a8292fb 100644
--- a/examples/foc/Kconfig
+++ b/examples/foc/Kconfig
@@ -148,8 +148,7 @@ endif # EXAMPLES_FOC_SENSORED
 config EXAMPLES_FOC_HAVE_OPENLOOP
 	bool "FOC example have open-loop controller"
 	select INDUSTRY_FOC_ANGLE_OPENLOOP
-	default y if EXAMPLES_FOC_SENSORLESS
-	default n
+	default EXAMPLES_FOC_SENSORLESS
 
 config EXAMPLES_FOC_HAVE_TORQ
 	bool "FOC example torque controller support"
@@ -157,8 +156,7 @@ config EXAMPLES_FOC_HAVE_TORQ
 
 config EXAMPLES_FOC_HAVE_VEL
 	bool "FOC example velocity controller support"
-	default y if EXAMPLES_FOC_SENSORLESS
-	default n
+	default EXAMPLES_FOC_SENSORLESS
 
 config EXAMPLES_FOC_HAVE_POS
 	bool "FOC example position controller support"
@@ -414,8 +412,7 @@ endmenu # FOC controller parameters
 
 config EXAMPLES_FOC_HAVE_RUN
 	bool
-	default y if !EXAMPLES_FOC_RUN_DISABLE
-	default n
+	default !EXAMPLES_FOC_RUN_DISABLE
 
 config EXAMPLES_FOC_RUN_DISABLE
 	bool "FOC Disable FOC motor controller"
diff --git a/examples/mld/Kconfig b/examples/mld/Kconfig
index 4816998bb..47e650c91 100644
--- a/examples/mld/Kconfig
+++ b/examples/mld/Kconfig
@@ -29,8 +29,7 @@ config EXAMPLES_MLD_STACKSIZE
 
 config EXAMPLES_MLD_INIT
 	bool "Initialize network"
-	default n if NSH_NETINIT
-	default y if !NSH_NETINIT
+	default !NSH_NETINIT
 	---help---
 		Include logic to initialize the network.  This should not be done if
 		the network is already initialized when nettest runs.  This is
diff --git a/examples/nettest/Kconfig b/examples/nettest/Kconfig
index 5c3d31fea..fe045c4de 100644
--- a/examples/nettest/Kconfig
+++ b/examples/nettest/Kconfig
@@ -129,8 +129,7 @@ endchoice # IP Domain
 
 config EXAMPLES_NETTEST_INIT
 	bool "Initialize network"
-	default n if NSH_NETINIT
-	default y if !NSH_NETINIT
+	default !NSH_NETINIT
 	depends on !EXAMPLES_NETTEST_LOOPBACK
 	---help---
 		Include logic to initialize the network.  This should not be done if
diff --git a/examples/tcpblaster/Kconfig b/examples/tcpblaster/Kconfig
index 7b5304744..7c768ae09 100644
--- a/examples/tcpblaster/Kconfig
+++ b/examples/tcpblaster/Kconfig
@@ -146,8 +146,7 @@ endchoice # IP Domain
 
 config EXAMPLES_TCPBLASTER_INIT
 	bool "Initialize network"
-	default n if NSH_NETINIT
-	default y if !NSH_NETINIT
+	default !NSH_NETINIT
 	depends on !EXAMPLES_TCPBLASTER_LOOPBACK
 	---help---
 		Include logic to initialize the network.  This should not be done if
diff --git a/examples/udp/Kconfig b/examples/udp/Kconfig
index 4914f655c..4b460bdf2 100644
--- a/examples/udp/Kconfig
+++ b/examples/udp/Kconfig
@@ -70,8 +70,7 @@ config EXAMPLES_UDP_DEVNAME
 
 config EXAMPLES_UDP_NETINIT
 	bool "Initialize network"
-	default n if NSH_NETINIT
-	default y if !NSH_NETINIT
+	default !NSH_NETINIT
 	---help---
 		Selecting this option will enable logic in the example to perform
 		some basic initialization of the network.  You would probably only
diff --git a/examples/udpblaster/Kconfig b/examples/udpblaster/Kconfig
index 606de1d5b..8dde2d619 100644
--- a/examples/udpblaster/Kconfig
+++ b/examples/udpblaster/Kconfig
@@ -57,8 +57,7 @@ endchoice # IP Domain
 
 config EXAMPLES_UDPBLASTER_INIT
 	bool "Initialize network"
-	default n if NSH_NETINIT
-	default y if !NSH_NETINIT
+	default !NSH_NETINIT
 	depends on !EXAMPLES_UDPBLASTER_LOOPBACK
 	---help---
 		Include logic to initialize the network.  This should not be done if
diff --git a/graphics/nxwidgets/Kconfig b/graphics/nxwidgets/Kconfig
index cfaefa7df..2de028f7f 100644
--- a/graphics/nxwidgets/Kconfig
+++ b/graphics/nxwidgets/Kconfig
@@ -18,8 +18,7 @@ menu "NX Server/Device Configuration"
 
 config NXWIDGETS_FLICKERFREE
 	bool "Enable Flicker Reduction Logic"
-	default y if NX_LCDDRIVER
-	default n if !NX_LCDDRIVER
+	default NX_LCDDRIVER
 	---help---
 		Because of their performance an in the manner in which they are
 		updated, LCDs may be prone to "flicker" in the displays when Widgets
diff --git a/graphics/nxwm/Kconfig b/graphics/nxwm/Kconfig
index 8a2b904d1..ab0fe9209 100644
--- a/graphics/nxwm/Kconfig
+++ b/graphics/nxwm/Kconfig
@@ -124,8 +124,7 @@ comment "Background Image"
 
 config NXWM_DISABLE_BACKGROUND_IMAGE
 	bool "Disable Background Image"
-	default n if !NXWM_DISABLE_MINIMIZE
-	default y if NXWM_DISABLE_MINIMIZE
+	default NXWM_DISABLE_MINIMIZE
 	---help---
 		Disable support for the "Desktop" background image.
 
@@ -465,8 +464,7 @@ menu "NxWM Touchscreen Configuration"
 
 config NXWM_TOUCHSCREEN
 	bool "Touchscreen Support"
-	default y if INPUT
-	default n if !INPUT
+	default INPUT
 	---help---
 		Define to build in touchscreen support.
 
diff --git a/netutils/webserver/Kconfig b/netutils/webserver/Kconfig
index 92fd293d2..1140f0c56 100644
--- a/netutils/webserver/Kconfig
+++ b/netutils/webserver/Kconfig
@@ -16,8 +16,7 @@ if NETUTILS_WEBSERVER
 
 config NETUTILS_HTTPD_SINGLECONNECT
 	bool "Single Connection"
-	default n if !DISABLE_PTHREAD
-	default y if DISABLE_PTHREAD
+	default DISABLE_PTHREAD
 	---help---
 		By default, the uIP web server will create a new, independent thread
 		for each connection.  This can, however, use a lot of stack space
@@ -28,15 +27,13 @@ config NETUTILS_HTTPD_SINGLECONNECT
 
 config NETUTILS_HTTPD_SCRIPT_DISABLE
 	bool "Disable %! scripting"
-	default y if NETUTILS_HTTPD_SENDFILE
-	default n if !NETUTILS_HTTPD_SENDFILE
+	default NETUTILS_HTTPD_SENDFILE
 	---help---
 		This option, if selected, will elide the %! scripting
 
 config NETUTILS_HTTPD_ENABLE_CHUNKED_ENCODING
 	bool "Enable HTTP chunked encoding"
-	default y if !NETUTILS_HTTPD_SCRIPT_DISABLE
-	default n if NETUTILS_HTTPD_SCRIPT_DISABLE
+	default !NETUTILS_HTTPD_SCRIPT_DISABLE
 	---help---
 		This option, if selected, will cause transmissions of blocks of
 		initially unknown size (e.g. dynamic content creation) to be sent
diff --git a/nshlib/Kconfig b/nshlib/Kconfig
index 7ff108153..6891ed5fd 100644
--- a/nshlib/Kconfig
+++ b/nshlib/Kconfig
@@ -650,8 +650,7 @@ config NSH_DISABLE_XD
 
 config NSH_DISABLE_RESET_CAUSE
 	bool "Disable reset cause"
-	default n if !DEFAULT_SMALL
-	default y if DEFAULT_SMALL
+	default DEFAULT_SMALL
 	depends on BOARDCTL_RESET_CAUSE
 
 endmenu