Patchwork [U-Boot] cmd editing: mark erase/tab seqs constant

login
register
mail settings
Submitter Mike Frysinger
Date Dec. 22, 2010, 2:40 p.m.
Message ID <1293028845-16111-1-git-send-email-vapier@gentoo.org>
Download mbox | patch
Permalink /patch/76411/
State Accepted
Commit 82359aec45506263042ffcecc2732cdf47def329
Delegated to: Wolfgang Denk
Headers show

Comments

Mike Frysinger - Dec. 22, 2010, 2:40 p.m.
These strings are only read, so no need to have them be writable.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
 common/main.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
Wolfgang Denk - Jan. 9, 2011, 5:04 p.m.
Dear Mike Frysinger,

In message <1293028845-16111-1-git-send-email-vapier@gentoo.org> you wrote:
> These strings are only read, so no need to have them be writable.
> 
> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
> ---
>  common/main.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

Patch

diff --git a/common/main.c b/common/main.c
index d97ccd7..fa7c49d 100644
--- a/common/main.c
+++ b/common/main.c
@@ -71,8 +71,8 @@  static int abortboot(int);
 char        console_buffer[CONFIG_SYS_CBSIZE + 1];	/* console I/O buffer	*/
 
 static char * delete_char (char *buffer, char *p, int *colp, int *np, int plen);
-static char erase_seq[] = "\b \b";		/* erase sequence	*/
-static char   tab_seq[] = "        ";		/* used to expand TABs	*/
+static const char erase_seq[] = "\b \b";		/* erase sequence	*/
+static const char   tab_seq[] = "        ";		/* used to expand TABs	*/
 
 #ifdef CONFIG_BOOT_RETRY_TIME
 static uint64_t endtime = 0;  /* must be set, default is instant timeout */