From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wolfgang Denk Date: Mon, 12 Jan 2015 22:12:29 +0100 Subject: [U-Boot] [PATCH] cmd_sf: Fix problem with "sf update" and unaligned length In-Reply-To: <54B380C2.4050208@keymile.com> References: <1420810762-10712-1-git-send-email-sr@denx.de> <20150112071719.055CB38005C@gemini.denx.de> <54B37759.7040801@denx.de> <54B380C2.4050208@keymile.com> Message-ID: <20150112211229.CBA60384DF9@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 Gerlando Falauto, In message <54B380C2.4050208@keymile.com> you wrote: > > That's right, and that's the whole point: cmp_buf points to the data > read from the flash sector before erasing it, because that's what we > want to keep (by re-writing it). > The first part, however, we overwrite with the new data (buf). > So there's nothing to erase. Well, if we have only a partially filled buffer, then there is some remainder which is left over from previous use. This should not make it to external storage. If you write any additional bytes, these should be known-to-be-harmless content, say all 0x00 or 0xFF bytes, but never any data that just happen to be there. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, Managing Director: Wolfgang Denk 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 For every complex problem, there is a solution that is simple, neat, and wrong. -- H. L. Mencken