Thread (15 messages) 15 messages, 2 authors, 2026-03-05

Re: [PATCH 1/6] mtd: rawnand: sunxi: fix sunxi_nand_ooblayout_free

From: Jernej Škrabec <jernej.skrabec@gmail.com>
Date: 2026-02-21 09:40:12
Also in: linux-sunxi, lkml

Dne petek, 20. februar 2026 ob 17:10:06 Srednjeevropski standardni čas je Richard Genoud napisal(a):
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@bootlin.com>
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?

Best regards,
Jernej
quoted hunk ↗ jump to hunk
---
 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;
 	}



Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help