]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
mtd: rawnand: sunxi: replace hard coded value by a define - take2
authorRichard Genoud <richard.genoud@bootlin.com>
Tue, 17 Mar 2026 14:24:32 +0000 (15:24 +0100)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Wed, 25 Mar 2026 14:27:30 +0000 (15:27 +0100)
commite3fd963da4c7469757d4f7741157fc5e23da47ed
treef89a80ea96311aac2805f7f0a36ec3a8ebb3f019
parent8fa72836be11ea70cbfa43f7f2253fa57ccc6ecd
mtd: rawnand: sunxi: replace hard coded value by a define - take2

The user data length (4) has been replaced almost all over the file, but
2 places were forgotten.

The user data is placed before the ECC, for each step.
So, in sunxi_nfc_hw_ecc_read_extra_oob(), the offset of the user data in
OOB is indeed ((ecc->bytes + USER_DATA_SZ) * ecc->steps);

And in sunxi_nand_ooblayout_ecc(), the offset of the ECC chunk in OOB is
the same offset plus the current user data size:
section * (ecc->bytes + USER_DATA_SZ) + USER_DATA_SZ;

Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Signed-off-by: Richard Genoud <richard.genoud@bootlin.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
drivers/mtd/nand/raw/sunxi_nand.c