Skip to contentSkip to conversation

Move test for unnecessary memmove to memmove_wd()

PATCH New Larry Johnson 2 participants 2 messages Apr 20, 2010 – May 5, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Move test for unnecessary memmove to memmove_wd()

---
 common/cmd_bootm.c |    7 ++-----
 common/image.c     |    3 +++
 2 files changed, 5 insertions(+), 5 deletions(-)
common/cmd_bootm.c +2 -5
index 452686d..da06009 100644
@@ -344,11 +344,8 @@ static int bootm_load_os(image_info_t os, ulong *load_end, int boot_progress)
 			printf ("   XIP %s ... ", type_name);
 		} else {
 			printf ("   Loading %s ... ", type_name);
-
-			if (load != image_start) {
-				memmove_wd ((void *)load,
-						(void *)image_start, image_len, CHUNKSZ);
-			}
+			memmove_wd ((void *)load, (void *)image_start,
+					image_len, CHUNKSZ);
 		}
 		*load_end = load + image_len;
 		puts("OK\n");
common/image.c +3 -0
index 9e49713..8d4be14 100644
@@ -450,6 +450,9 @@ phys_size_t getenv_bootm_size(void)
 
 void memmove_wd (void *to, void *from, size_t len, ulong chunksz)
 {
+	if (to == from)
+		return;
+
 #if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG)
 	while (len > 0) {
 		size_t tail = (len > chunksz) ? chunksz : len;
Signature · 1 line
1.5.4.3
#1 lore raw

PATCH 1/1 Move test for unnecessary memmove to memmove_wd()

Dear Larry Johnson,

Quoted 5 lines · In message <[email protected]> you wrote:
---
 common/cmd_bootm.c |    7 ++-----
 common/image.c     |    3 +++
 2 files changed, 5 insertions(+), 5 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

Signature · 5 lines
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
You!  What PLANET is this!
	-- McCoy, "The City on the Edge of Forever", stardate 3134.0