Re: [PATCH 1/6] mtd: rawnand: sunxi: fix sunxi_nand_ooblayout_free
From: Richard GENOUD
Date: Thu Mar 05 2026 - 04:26:38 EST
Le 21/02/2026 à 10:13, Jernej Škrabec a écrit :
Dne petek, 20. februar 2026 ob 17:10:06 Srednjeevropski standardni čas je Richard Genoud napisal(a):Yes, it's more a code clarification, I'll reword that.
The available length is really USER_DATA_LEN - 2 instead of just 2 (the
user data length minus the BBM length)
That doesn't change anything now, but if USER_DATA_LEN changes, it will.
s/USER_DATA_LEN/USER_DATA_SZ/
Signed-off-by: Richard Genoud <richard.genoud@xxxxxxxxxxx>
If this is really a fix as subject suggest, then Fixes tag is in order. However,
this looks more like code refactor as end result is the same. So maybe
reword subject?
Thanks!
Best regards,
Jernej
---
drivers/mtd/nand/raw/sunxi_nand.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/mtd/nand/raw/sunxi_nand.c b/drivers/mtd/nand/raw/sunxi_nand.c
index 9dcdc93734cb..c420909b944b 100644
--- a/drivers/mtd/nand/raw/sunxi_nand.c
+++ b/drivers/mtd/nand/raw/sunxi_nand.c
@@ -1761,12 +1761,12 @@ static int sunxi_nand_ooblayout_free(struct mtd_info *mtd, int section,
/*
* The first 2 bytes are used for BB markers, hence we
- * only have 2 bytes available in the first user data
+ * only have USER_DATA_SZ - 2 bytes available in the first user data
* section.
*/
if (!section && ecc->engine_type == NAND_ECC_ENGINE_TYPE_ON_HOST) {
oobregion->offset = 2;
- oobregion->length = 2;
+ oobregion->length = USER_DATA_SZ - 2;
return 0;
}