[PATCH 01/20] mtd: nand: ecc: Add an I/O request tweaking mechanism
Thomas Petazzoni
thomas.petazzoni at bootlin.com
Wed Sep 30 03:53:08 EDT 2020
Hello,
On Wed, 30 Sep 2020 01:01:05 +0200
Miquel Raynal <miquel.raynal at bootlin.com> wrote:
> + /* Ensure the request covers the entire page */
> + if (true) {//todo (orig->datalen < nanddev_page_size(nand)) {
This TODO and "if (true)" looks odd.
> + ctx->bounce_data = true;
> + tweak->dataoffs = 0;
> + tweak->datalen = nanddev_page_size(nand);
> + tweak->databuf.in = ctx->spare_databuf;
> + memset(tweak->databuf.in, 0xFF, ctx->page_buffer_size);
> + }
> +
> + if (true) {//todo (orig->ooblen < nanddev_per_page_oobsize(nand)) {
Ditto.
Also, I find the wording "tweak" a bit vague, "tweak" really means
nothing specific. What about prepare/unprepare instead of tweak/restore ?
Also, shouldn't nand_ecc_init_req_tweaking() also allocate the struct
nand_ecc_req_tweak_ctx so that this structure remains internal ?
Thomas
--
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
More information about the linux-mtd
mailing list