Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Richard Genoud and committed by
Miquel Raynal
87f9c59f ee78d466

+2 -2
+2 -2
drivers/mtd/nand/raw/sunxi_nand.c
··· 1755 1755 1756 1756 /* 1757 1757 * 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 1759 1759 * section. 1760 1760 */ 1761 1761 if (!section && ecc->engine_type == NAND_ECC_ENGINE_TYPE_ON_HOST) { 1762 1762 oobregion->offset = 2; 1763 - oobregion->length = 2; 1763 + oobregion->length = USER_DATA_SZ - 2; 1764 1764 1765 1765 return 0; 1766 1766 }