public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Jerry Van Baren <gvb.uboot@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] [PATCH] LIBFDT: use memmove() instead of memcpy()
Date: Mon, 7 Jan 2008 23:51:21 -0500	[thread overview]
Message-ID: <20080108045121.GA12277@cideas.com> (raw)

This is partial patch from the DTC/libfdt
commit  67b6b33b9b413a450a72135b5dc59c0a1e33e647
Author: David Gibson <david@gibson.dropbear.id.au>
Date:   Wed Nov 21 11:56:14 2007 +1100

    The patch also fixes one genuine bug caught by valgrind -
    _packblocks() in fdt_rw.c was using memcpy() where it should have been
    using memmove().

Signed-off-by: Gerald Van Baren <vanbaren@cideas.com>
---

After comparing dtc/libfdt source to our libfdt source, I found we were
missing this partial patch.  The rest of the patch is not applicable.

gvb

 libfdt/fdt_rw.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/libfdt/fdt_rw.c b/libfdt/fdt_rw.c
index dfe5628..6673f8e 100644
--- a/libfdt/fdt_rw.c
+++ b/libfdt/fdt_rw.c
@@ -358,12 +358,12 @@ static void _packblocks(const void *fdt, void *buf,
 	memmove(buf + mem_rsv_off, fdt + fdt_off_mem_rsvmap(fdt), mem_rsv_size);
 	fdt_set_off_mem_rsvmap(buf, mem_rsv_off);
 
-	memcpy(buf + struct_off, fdt + fdt_off_dt_struct(fdt), struct_size);
+	memmove(buf + struct_off, fdt + fdt_off_dt_struct(fdt), struct_size);
 	fdt_set_off_dt_struct(buf, struct_off);
 	fdt_set_size_dt_struct(buf, struct_size);
 
-	memcpy(buf + strings_off, fdt + fdt_off_dt_strings(fdt),
-	       fdt_size_dt_strings(fdt));
+	memmove(buf + strings_off, fdt + fdt_off_dt_strings(fdt),
+		fdt_size_dt_strings(fdt));
 	fdt_set_off_dt_strings(buf, strings_off);
 	fdt_set_size_dt_strings(buf, fdt_size_dt_strings(fdt));
 }
-- 
1.5.3.7

                 reply	other threads:[~2008-01-08  4:51 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20080108045121.GA12277@cideas.com \
    --to=gvb.uboot@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox