aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2022-02-18 11:32:18 -0500
committerTom Rini <trini@konsulko.com>2022-02-18 11:44:37 -0500
commit2f042d978fae95d1a9c03f50befc8e315816f4b7 (patch)
tree5fd8710cfb9b75f0a70f05f72c06009b07462ed8
parent1f94b1547d48a7703f2429764cc0006872d50134 (diff)
downloadu-boot-RFC/RFCv2-modernize-hush.zip
u-boot-RFC/RFCv2-modernize-hush.tar.gz
u-boot-RFC/RFCv2-modernize-hush.tar.bz2
cmd: Default to new parser, hackup warning fixesRFC/RFCv2-modernize-hush
Signed-off-by: Tom Rini <trini@konsulko.com>
-rw-r--r--cmd/Kconfig2
-rw-r--r--common/cli_hush_2021.c6
-rw-r--r--common/cli_hush_upstream.c5
3 files changed, 4 insertions, 9 deletions
diff --git a/cmd/Kconfig b/cmd/Kconfig
index aad859e..fda7767 100644
--- a/cmd/Kconfig
+++ b/cmd/Kconfig
@@ -26,7 +26,7 @@ config HUSH_PARSER
choice HUSH_FLAVOR
bool "Hush flavor to use"
depends on HUSH_PARSER
- default HUSH_OLD_PARSER
+ default HUSH_2021_PARSER
config HUSH_OLD_PARSER
bool "Use hush old parser"
diff --git a/common/cli_hush_2021.c b/common/cli_hush_2021.c
index 73c21ed..de78e9a 100644
--- a/common/cli_hush_2021.c
+++ b/common/cli_hush_2021.c
@@ -40,12 +40,6 @@
#define USE_FOR_NOMMU(...) __VA_ARGS__
#define USE_FOR_MMU(...)
-/* TODO: Drop this before upstreaming */
-#ifdef CONFIG_SYS_PROMPT
-#undef CONFIG_SYS_PROMPT
-#define CONFIG_SYS_PROMPT "2021> "
-#endif /* CONFIG_SYS_PROMPT */
-
/*
* Size-saving "small" ints (arch-dependent)
*/
diff --git a/common/cli_hush_upstream.c b/common/cli_hush_upstream.c
index 498fd8d..6297ea8 100644
--- a/common/cli_hush_upstream.c
+++ b/common/cli_hush_upstream.c
@@ -1448,6 +1448,7 @@ static void xxfree(void *ptr)
* HUSH_DEBUG >= 2 prints line number in this file where it was detected.
*/
#if HUSH_DEBUG < 2
+#include <linux/compiler.h>
# define msg_and_die_if_script(lineno, ...) msg_and_die_if_script(__VA_ARGS__)
# define syntax_error(lineno, msg) syntax_error(msg)
# define syntax_error_at(lineno, msg) syntax_error_at(msg)
@@ -1465,7 +1466,7 @@ static void die_if_script(void)
}
}
-static void msg_and_die_if_script(unsigned lineno, const char *fmt, ...)
+static void __maybe_unused msg_and_die_if_script(unsigned lineno, const char *fmt, ...)
{
va_list p;
@@ -1539,7 +1540,7 @@ static void syntax_error_unexpected_ch(unsigned lineno UNUSED_PARAM, int ch)
/* Replace each \x with x in place, return ptr past NUL. */
static char *unbackslash(char *src)
{
- char *dst = src = strchrnul(src, '\\');
+ char *dst = src = (char *)strchrnul(src, '\\');
while (1) {
if (*src == '\\') {
src++;