Skip to contentSkip to conversation

cmd/onenand.c: block align warning

PATCH In review Ladislav Michl 2 participants 2 messages Sep 13, 2016 – Oct 8, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cmd/onenand.c: block align warning

An attempt to write non block aligned data fails silently, add warning and set result.

---
 cmd/onenand.c | 6 ++++++
 1 file changed, 6 insertions(+)
cmd/onenand.c +6 -0
index feab01a..090f835 100644
@@ -139,6 +139,12 @@ static int onenand_block_write(loff_t to, size_t len,
 	size_t _retlen = 0;
 	int ret;
 
+	if ((to & (mtd->writesize - 1)) != 0) {
+		printf("Attempt to write non block-aligned data\n");
+		*retlen = 0;
+		return 1;
+	}
+
 	if (to == next_ofs) {
 		next_ofs = to + len;
 		to += skip_ofs;
Signature · 1 line
2.1.4
#1 lore raw
Quoted 4 lines · Ladislav Michl

An attempt to write non block aligned data fails silently, add warning and set result.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20161008/194da4d0/attachment.sig>