* [U-Boot] [PATCH] cmd/onenand.c: block align warning
@ 2016-09-13 5:40 Ladislav Michl
2016-10-08 17:05 ` [U-Boot] " Tom Rini
0 siblings, 1 reply; 2+ messages in thread
From: Ladislav Michl @ 2016-09-13 5:40 UTC (permalink / raw)
To: u-boot
An attempt to write non block aligned data fails silently, add warning and
set result.
Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
---
cmd/onenand.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/cmd/onenand.c b/cmd/onenand.c
index feab01a..090f835 100644
--- a/cmd/onenand.c
+++ b/cmd/onenand.c
@@ -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;
--
2.1.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [U-Boot] cmd/onenand.c: block align warning
2016-09-13 5:40 [U-Boot] [PATCH] cmd/onenand.c: block align warning Ladislav Michl
@ 2016-10-08 17:05 ` Tom Rini
0 siblings, 0 replies; 2+ messages in thread
From: Tom Rini @ 2016-10-08 17:05 UTC (permalink / raw)
To: u-boot
On Tue, Sep 13, 2016 at 07:40:00AM +0200, Ladislav Michl wrote:
> An attempt to write non block aligned data fails silently, add warning and
> set result.
>
> Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
Applied to u-boot/master, thanks!
--
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>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-10-08 17:05 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-13 5:40 [U-Boot] [PATCH] cmd/onenand.c: block align warning Ladislav Michl
2016-10-08 17:05 ` [U-Boot] " Tom Rini
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.