From nobody Tue Apr 7 10:47:40 2026 Received: from smtpout-03.galae.net (smtpout-03.galae.net [185.246.85.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 56A091A9FB7 for ; Tue, 17 Mar 2026 14:24:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.246.85.4 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773757494; cv=none; b=tA1EWNIxQ+qGCqU6Gr3YDTb1a3rpZVXvr20vzA9jFaMbTZuDwhJOn2UBGnXXDP2T1ex13hqMRT4PwDvsn8Bn/NGZLUKALAY3AEy6dPxao7mBXHB8VG1wwWt7Ws7GWvuJa7QXp3yZ7KCR0OC0f95j32WLIxMP5rQ4wPxC7bcM2zs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773757494; c=relaxed/simple; bh=82jHg/C84we0ggMOiWeHcRKzXN+cdC4vj8XTNcKMh+Y=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Qm7xftp5Nk9skBgNEecfGhnFfXWpP5dYPlXuEI1zm3IRBmiSdaqaHRLx1tBEjIm+33++7t1tnjj1DdrRoDjfGYcTFCYagkqAwaXCxnrE3eMtiHsIpNFP5md5IHXEue/Jr5BmI5h1BuORBTsZIC0kSPAZ0xFSNk3iY44d06GvXRA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=Wseylebr; arc=none smtp.client-ip=185.246.85.4 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="Wseylebr" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-03.galae.net (Postfix) with ESMTPS id 00B1E4E42656; Tue, 17 Mar 2026 14:24:52 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id C8FFE5FC9A; Tue, 17 Mar 2026 14:24:51 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id E11D7104505FB; Tue, 17 Mar 2026 15:24:48 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1773757491; h=from:subject:date:message-id:to:cc:mime-version: content-transfer-encoding:in-reply-to:references; bh=1fl+dYL251xXhtusEZ7b8g0kjCughX2VCuIW1qgsL2Q=; b=WseylebrZ8OgCzJNFztlPs25EauF7UnbXMoCwCAXTdAhRWD/i1MJTbLQrPV1tdXufR8tVW oyA06yE0NnU4U62RqsGMuFf0HsLf4MXSsRT7sxBYhGQXz9Gxouode6wEQtIXvgEFPb+xvg AdpNlYJqv6Qa7cDnYiSv6+jhj8k7tl9l7XPPEXdoWhh3VjgjG56kJSEBkwOYCk47LrsHzX T83aV+1B//hI98Fjyvx1Fc/sCT1aVkmpMt0nQe9PS4v4zqrpc6QswdeD7Zd6Iuc0lStGjl DviFp9sCciEyNy7tL5X+TFoptfWVmUATqhsOhB3oCqM+BTASnKLuPk+k96goPQ== From: Richard Genoud To: Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland Cc: Wentao Liang , Maxime Ripard , Boris Brezillon , Thomas Petazzoni , linux-mtd@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, Richard Genoud Subject: [PATCH v3 1/9] mtd: rawnand: sunxi: sunxi_nand_ooblayout_free code clarification Date: Tue, 17 Mar 2026 15:24:29 +0100 Message-ID: <20260317142437.580204-2-richard.genoud@bootlin.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260317142437.580204-1-richard.genoud@bootlin.com> References: <20260317142437.580204-1-richard.genoud@bootlin.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Last-TLS-Session-Version: TLSv1.3 Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: Chen-Yu Tsai --- 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 e66adfcca7cd..915f1240546f 100644 --- a/drivers/mtd/nand/raw/sunxi_nand.c +++ b/drivers/mtd/nand/raw/sunxi_nand.c @@ -1755,12 +1755,12 @@ static int sunxi_nand_ooblayout_free(struct mtd_inf= o *mtd, int section, =20 /* * 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 =3D=3D NAND_ECC_ENGINE_TYPE_ON_HOST) { oobregion->offset =3D 2; - oobregion->length =3D 2; + oobregion->length =3D USER_DATA_SZ - 2; =20 return 0; }