Instead of using two different output buffers for OOB data, let's just
use the same one for all output. This adds an extra memcpy, but it
simplifies some future work, so it's worth it.
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
oobreadbuf + start,
len);
}
+ } else {
+ memcpy(oobbuf, oobreadbuf, mtd.oob_size);
}
/* Write OOB data first, as ecc will be placed in there */
if (mtd_write_oob(mtd_desc, &mtd, fd, mtdoffset,
- mtd.oob_size,
- noecc ? oobreadbuf : oobbuf)) {
+ mtd.oob_size, oobbuf)) {
sys_errmsg("%s: MTD writeoob failure", mtd_device);
goto closeall;
}