diff mbox

[U-Boot,1/2] Allow CONFIG_REGEX to be disabled when CONFIG_NET

Message ID 1435013858-1279-1-git-send-email-joe.hershberger@ni.com
State Accepted
Delegated to: Tom Rini
Headers show

Commit Message

Joe Hershberger June 22, 2015, 10:57 p.m. UTC
Instead of selecting REGEX when NET is enabled, make it the default, but
allow boards that are tiny to disable it and lose functionality on all
but the first Ethernet adapter.

cm-bf548, bf538f-ezkit, and bf533-stamp need this. None appear to have
more than one Ethernet interface.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
---

 include/env_callback.h | 4 +++-
 lib/Kconfig            | 1 +
 net/Kconfig            | 1 -
 3 files changed, 4 insertions(+), 2 deletions(-)

Comments

Joe Hershberger July 8, 2015, 4:37 a.m. UTC | #1
Hi Tom,

On Mon, Jun 22, 2015 at 5:57 PM, Joe Hershberger <joe.hershberger@ni.com> wrote:
> Instead of selecting REGEX when NET is enabled, make it the default, but
> allow boards that are tiny to disable it and lose functionality on all
> but the first Ethernet adapter.
>
> cm-bf548, bf538f-ezkit, and bf533-stamp need this. None appear to have
> more than one Ethernet interface.
>
> Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
> ---

This is a build fix, so it should probably be part of v2015.07.

Cheers,
-Joe
Tom Rini July 10, 2015, 12:56 p.m. UTC | #2
On Mon, Jun 22, 2015 at 05:57:36PM -0500, Joe Hershberger wrote:

> Instead of selecting REGEX when NET is enabled, make it the default, but
> allow boards that are tiny to disable it and lose functionality on all
> but the first Ethernet adapter.
> 
> cm-bf548, bf538f-ezkit, and bf533-stamp need this. None appear to have
> more than one Ethernet interface.
> 
> Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>

Applied to u-boot/master, thanks!
diff mbox

Patch

diff --git a/include/env_callback.h b/include/env_callback.h
index ab5d42d..90b95b5 100644
--- a/include/env_callback.h
+++ b/include/env_callback.h
@@ -33,8 +33,10 @@ 
 
 #ifdef CONFIG_REGEX
 #define ENV_DOT_ESCAPE "\\"
+#define ETHADDR_WILDCARD "\\d?"
 #else
 #define ENV_DOT_ESCAPE
+#define ETHADDR_WILDCARD
 #endif
 
 #ifdef CONFIG_CMD_DNS
@@ -53,7 +55,7 @@ 
 	"nvlan:nvlan," \
 	"vlan:vlan," \
 	DNS_CALLBACK \
-	"eth\\d?addr:ethaddr,"
+	"eth" ETHADDR_WILDCARD "addr:ethaddr,"
 #else
 #define NET_CALLBACKS
 #endif
diff --git a/lib/Kconfig b/lib/Kconfig
index 7ec8c98..c98d399 100644
--- a/lib/Kconfig
+++ b/lib/Kconfig
@@ -38,6 +38,7 @@  config SYS_VSNPRINTF
 
 config REGEX
 	bool "Enable regular expression support"
+	default y if NET
 	help
 	  If this variable is defined, U-Boot is linked against the
 	  SLRE (Super Light Regular Expression) library, which adds
diff --git a/net/Kconfig b/net/Kconfig
index 9a9846e..915371d 100644
--- a/net/Kconfig
+++ b/net/Kconfig
@@ -4,7 +4,6 @@ 
 
 menuconfig NET
 	bool "Networking support"
-	select REGEX
 
 if NET