From: Wolfgang Denk Date: Sat, 07 Aug 2010 21:50:00 +0200 Subject: [U-Boot] [PATCH] get_ram_size: memory content of base address was not restored In-Reply-To: <1274771093-29677-1-git-send-email-ratbert.chuang@gmail.com> References: <1274771093-29677-1-git-send-email-ratbert.chuang@gmail.com> Message-ID: <20100807195000.735411536EF@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear ratbert.chuang at gmail.com, In message <1274771093-29677-1-git-send-email-ratbert.chuang@gmail.com> you wrote: > From: Po-Yu Chuang > > > Signed-off-by: Po-Yu Chuang > --- > common/memsize.c | 1 + > 1 files changed, 1 insertions(+), 0 deletions(-) > > diff --git a/common/memsize.c b/common/memsize.c > index 6c275c9..99469ab 100644 > --- a/common/memsize.c > +++ b/common/memsize.c > @@ -74,6 +74,7 @@ long get_ram_size(volatile long *base, long maxsize) > return (0); > } > > + *addr = save[i]; > for (cnt = 1; cnt < maxsize / sizeof (long); cnt <<= 1) { > addr = base + cnt; /* pointer arith! */ > val = *addr; I think this patch is wrong. The value at address (base + 0) is never saved, so there is no need to restore it (nor did we store it's value anywhere). Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de The important thing about being a leader is not being right or wrong, but being *certain*. - Terry Pratchett, _Truckers_