Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 242761
b: refs/heads/master
c: e6da856
h: refs/heads/master
i:
  242759: 53fec9a
v: v3
  • Loading branch information
Roman Tereshonkov authored and David Woodhouse committed Mar 11, 2011
1 parent 70dfa7e commit 4b2fdc5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b085058fe556328443f982d892c9657b3aff9d4a
refs/heads/master: e6da85685b2dec1e69e58366c22d1f883d6da575
10 changes: 5 additions & 5 deletions trunk/drivers/mtd/onenand/onenand_base.c
Original file line number Diff line number Diff line change
Expand Up @@ -1648,11 +1648,10 @@ static int onenand_verify(struct mtd_info *mtd, const u_char *buf, loff_t addr,
int ret = 0;
int thislen, column;

column = addr & (this->writesize - 1);

while (len != 0) {
thislen = min_t(int, this->writesize, len);
column = addr & (this->writesize - 1);
if (column + thislen > this->writesize)
thislen = this->writesize - column;
thislen = min_t(int, this->writesize - column, len);

this->command(mtd, ONENAND_CMD_READ, addr, this->writesize);

Expand All @@ -1666,12 +1665,13 @@ static int onenand_verify(struct mtd_info *mtd, const u_char *buf, loff_t addr,

this->read_bufferram(mtd, ONENAND_DATARAM, this->verify_buf, 0, mtd->writesize);

if (memcmp(buf, this->verify_buf, thislen))
if (memcmp(buf, this->verify_buf + column, thislen))
return -EBADMSG;

len -= thislen;
buf += thislen;
addr += thislen;
column = 0;
}

return 0;
Expand Down

0 comments on commit 4b2fdc5

Please sign in to comment.