mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-25 06:46:00 +00:00
cmd/onenand.c: block align warning
An attempt to write non block aligned data fails silently, add warning and set result. Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
This commit is contained in:
parent
362664356b
commit
9c00d982f1
1 changed files with 6 additions and 0 deletions
|
@ -139,6 +139,12 @@ static int onenand_block_write(loff_t to, size_t len,
|
||||||
size_t _retlen = 0;
|
size_t _retlen = 0;
|
||||||
int ret;
|
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) {
|
if (to == next_ofs) {
|
||||||
next_ofs = to + len;
|
next_ofs = to + len;
|
||||||
to += skip_ofs;
|
to += skip_ofs;
|
||||||
|
|
Loading…
Add table
Reference in a new issue