From: Andrew Dyer <amdyer@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] PATCH for cmd_mem.c:do_mem_mtest()
Date: Tue, 13 Sep 2005 11:09:49 -0500 [thread overview]
Message-ID: <c166aa9f0509130909544387fd@mail.gmail.com> (raw)
Sorry the patch below isn't from git - I hope it's still acceptable.
I've put a copy in the body and attached it incase gmail
decides to line wrap the text.
ChangeLog:
* Patch by Andrew Dyer, 13 September 2005:
if CFG_ALT_MEMTEST is defined without
CFG_MEMTEST_SCRATCH, cmd_mem.c
code will dereference a null pointer. Change
the code to use the last word of the memory test
area as the scratch location in this case. Print
the scratch memory location used.
Signed-off-by: Andrew Dyer <amdyer@gmail.com>
Index: common/cmd_mem.c
===================================================================
RCS file: /home/cvsroot/Projects/u-boot/common/cmd_mem.c,v
retrieving revision 1.1.1.1
diff -p -u -r1.1.1.1 cmd_mem.c
--- common/cmd_mem.c 28 Jun 2005 17:32:26 -0000 1.1.1.1
+++ common/cmd_mem.c 13 Sep 2005 10:40:26 -0000
@@ -707,7 +707,7 @@ int do_mem_mtest (cmd_tbl_t *cmdtp, int
#if defined(CFG_MEMTEST_SCRATCH)
vu_long *dummy = (vu_long*)CFG_MEMTEST_SCRATCH;
#else
- vu_long *dummy = NULL;
+ vu_long *dummy;
#endif
int j;
int iterations = 1;
@@ -747,7 +747,17 @@ int do_mem_mtest (cmd_tbl_t *cmdtp, int
}
#if defined(CFG_ALT_MEMTEST)
+
+#if !defined(CFG_MEMTEST_SCRATCH)
+ /* if no fixed scratch area is defined use
+ * the last location of the test area
+ */
+ end--;
+ dummy = end;
+#endif
+
printf ("Testing %08x ... %08x:\n", (uint)start, (uint)end);
+ printf ("using address %08x as scratch\n",dummy);
PRINTF("%s:%d: start 0x%p end 0x%p\n",
__FUNCTION__, __LINE__, start, end);
--
Hardware, n.:
The parts of a computer system that can be kicked.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: u-boot-memtest-patch.txt
Url: http://lists.denx.de/pipermail/u-boot/attachments/20050913/23287345/attachment.txt
next reply other threads:[~2005-09-13 16:09 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-09-13 16:09 Andrew Dyer [this message]
2005-09-13 16:18 ` [U-Boot-Users] PATCH for cmd_mem.c:do_mem_mtest() Wolfgang Denk
2005-09-13 16:31 ` Ladislav Michl
2005-09-13 18:04 ` Wolfgang Denk
2005-09-13 19:26 ` [U-Boot-Users] ppcboot_stage2 manju mahajan
2005-10-03 16:52 ` Sam Pham
2005-10-03 19:37 ` Wolfgang Denk
2005-10-04 15:49 ` Sam Pham
2005-09-14 8:09 ` [U-Boot-Users] PATCH for cmd_mem.c:do_mem_mtest() Ladislav Michl
2006-07-22 19:03 ` Wolfgang Denk
2005-09-13 16:55 ` Andrew Dyer
2005-09-13 18:27 ` Wolfgang Denk
2005-09-13 18:43 ` Jerry Van Baren
2005-09-13 19:54 ` Wolfgang Denk
2005-09-13 20:08 ` Jerry Van Baren
2005-09-13 20:26 ` Andrew Dyer
2005-09-13 21:08 ` Wolfgang Denk
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c166aa9f0509130909544387fd@mail.gmail.com \
--to=amdyer@gmail.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.