From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtpout-04.galae.net (smtpout-04.galae.net [185.171.202.116]) (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 E0D3D17A309 for ; Wed, 18 Mar 2026 07:15:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.171.202.116 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773818155; cv=none; b=pYxQ5oh02HC7rYNplBPQ/aKsJexRmqMJFyWMxDxUXVo1Muaszbu2ElGhVtZPoCYqvgjBjqkpPMGJDcNUijhsEN6wbRox080jo08WGcJVJU/bMiBJuGt4kMgDRVTKUfZz7C5t/upgiQToPwcuLT39XpSHk++/508ZiS9r2t7OOdY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773818155; c=relaxed/simple; bh=5pvdvLvDF6nBad9lMPLtr5giq72Pgbs1flIwwqIgVTc=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=KiLuVD7lyj65gUcTUnnQI+XQtlgFqDlIF2pD2VOM1avn4zNwATAvIoCSaznan9R18p4AupE/5np42WXpd9v0kBEaKQ+w7VPV817bLGnUQWmRcVNsH9dL6vAo5VDQPvFSm4MbOMFZx82W8f7NmDv+4p2QsWMNdaKxwG2KtjX78mk= 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=MVz6+6Fr; arc=none smtp.client-ip=185.171.202.116 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="MVz6+6Fr" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-04.galae.net (Postfix) with ESMTPS id 68149C55067; Wed, 18 Mar 2026 07:16:15 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id E9D3E6004F; Wed, 18 Mar 2026 07:15:50 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id CBCEF104506E6; Wed, 18 Mar 2026 08:15:27 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1773818134; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:content-language:in-reply-to:references; bh=f/wnit4uOPVq9r5YYUpYnHPITSDBvtEYXdALfE4LR18=; b=MVz6+6FroWlHDW6mHXGBgHiCJxCjhwZKsOAGUkwiONmck9b4YySN1cTUmfcih1U2tnoXMu OfOKaONHfmMdsmNqeYxN9hXpuZ4ZWGFdSNTzBZfORX8abPOwIoNCN8P3Klxz93J8LDBtpY aZ8WeKwHGUL/pzZh2UVvDjsJ1pAfbPgSXTnAQHMsQ3faY/PKQdBJrJWHiQ5X/OQU5oI9Ek omix2N/SK9A5WrXMoaK/cZXLXrwoqFxTLLHH8mRQ+K0l5lCfolJCTtbqQnSSHeTh3TM6GT hZI0PbR/WSGzlfmH8mXtT5SwuiAuZuxRYhWhV6HOLWiXYTKSnINke3xRo475MQ== Message-ID: <9c9d7aea-0227-491b-92d4-5cc4d142e1de@bootlin.com> Date: Wed, 18 Mar 2026 08:15:26 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 1/9] mtd: rawnand: sunxi: sunxi_nand_ooblayout_free code clarification 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 References: <20260317142437.580204-1-richard.genoud@bootlin.com> <20260317142437.580204-2-richard.genoud@bootlin.com> From: Richard GENOUD Content-Language: en-US, fr Organization: Bootlin In-Reply-To: <20260317142437.580204-2-richard.genoud@bootlin.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Last-TLS-Session-Version: TLSv1.3 Le 17/03/2026 à 15:24, Richard Genoud a écrit : > 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 Sorry, I forgot to pick-up the review from Chen-Yu in v2: 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_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; > } >