Skip to content
Snippets Groups Projects
Commit b09ece08 authored by Alexandru Gagniuc's avatar Alexandru Gagniuc Committed by Tom Rini
Browse files

common/xyzModem.c: Do not use hard-coded address for debug buffer


Under the plethora of #ifdefs, the xyzModem code hid this pearl:
static char *zm_out = (char *) 0x00380000;
This was only enabled when DEBUG is defined, so it's probably why it
went unnoticed for so long. No idea what platform had memory at that
exact location, but the this approach is extremely hacky.
Use a static buffer instead.

Signed-off-by: default avatarAlexandru Gagniuc <alex.g@adaptrum.com>
parent 306b236b
No related branches found
No related tags found
No related merge requests found
...@@ -176,16 +176,10 @@ parse_num (char *s, unsigned long *val, char **es, char *delim) ...@@ -176,16 +176,10 @@ parse_num (char *s, unsigned long *val, char **es, char *delim)
/* /*
* Note: this debug setup works by storing the strings in a fixed buffer * Note: this debug setup works by storing the strings in a fixed buffer
*/ */
#define FINAL static char zm_debug_buf[8192];
#ifdef FINAL static char *zm_out = zm_debug_buf;
static char *zm_out = (char *) 0x00380000; static char *zm_out_start = zm_debug_buf;
static char *zm_out_start = (char *) 0x00380000;
#else
static char zm_buf[8192];
static char *zm_out = zm_buf;
static char *zm_out_start = zm_buf;
#endif
static int static int
zm_dprintf (char *fmt, ...) zm_dprintf (char *fmt, ...)
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment