Add --skip-all-ffs option to mtd-utils nandwrite
David Oberhollenzer
david.oberhollenzer at sigma-star.at
Wed Dec 7 00:21:26 PST 2016
On 12/07/2016 06:01 AM, Marek Vasut wrote:
> + if (skipallffs)
> + {
> + for (ii = 0; ii < mtd.min_io_size; ii +=
> sizeof(uint32_t))
> + {
> + if (*(uint32_t*)(writebuf + ii) !=
> 0xffffffff)
> + break;
>
> Is this memcmp()-alike function ?
>
> + }
> + if (ii == mtd.min_io_size)
> + allffs = 1;
> + }
> + if (!allffs) {
The point of the patch is not to write a page that is filled with 0xFF bytes.
A feature that is turned off by default and can be activated via a command
line switch.
The code you are trying to replace tries to figure out if an entire block of
memory is set to 0xFF. The code path should be conditional, as this feature
is turned off unless explicitly requested.
> This could be simply turned to:
>
> ret = 0;
> if (!memcmp(writebuf, writebuf + 1, mtd.min_io_size - 1)) {
> ret = mtd_write(....);
> }
This does something completely different.
More information about the linux-mtd
mailing list