Skip to content

Commit 87f9c59

Browse files
richard-bootlinmiquelraynal
authored andcommitted
mtd: rawnand: sunxi: sunxi_nand_ooblayout_free code clarification
The available length is really USER_DATA_LEN - 2 instead of just 2 (the user data length minus the BBM length) USER_DATA_LEN being 4, that doesn't change anything now, but if USER_DATA_LEN changes, it will. Signed-off-by: Richard Genoud <richard.genoud@bootlin.com> Reviewed-by: Chen-Yu Tsai <wens@kernel.org> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
1 parent ee78d46 commit 87f9c59

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/mtd/nand/raw/sunxi_nand.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1755,12 +1755,12 @@ static int sunxi_nand_ooblayout_free(struct mtd_info *mtd, int section,
17551755

17561756
/*
17571757
* The first 2 bytes are used for BB markers, hence we
1758-
* only have 2 bytes available in the first user data
1758+
* only have USER_DATA_SZ - 2 bytes available in the first user data
17591759
* section.
17601760
*/
17611761
if (!section && ecc->engine_type == NAND_ECC_ENGINE_TYPE_ON_HOST) {
17621762
oobregion->offset = 2;
1763-
oobregion->length = 2;
1763+
oobregion->length = USER_DATA_SZ - 2;
17641764

17651765
return 0;
17661766
}

0 commit comments

Comments
 (0)