From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ECAD53358D0 for ; Sat, 21 Feb 2026 09:40:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.49 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771666808; cv=none; b=Mh0wethLybGFXiX+UIBMQ6cNH+Aatuyz4qfrw73ZufJH84kD0A5sDZTI/rojPHO1Mmp3Zz1T4BnnbJAl5jOxMnLj92sEPSfJlyx0wtJX/mO4dAuy8JFC+zd9YPIg2E8PkCDJylqNxC3oaEj9Mo+G2/divnjqQCvpmrMu8wTGtZM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771666808; c=relaxed/simple; bh=N+ioHBxopYxMiJdZhLppyoVXxg4UFuHhYCAxFEhX89A=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=tHC+6V2Lg5LHAXhLywtabR/yneoNKYZxKHTkXYrAjFt6zNXxdjymP9yOcvuJWWfwPwilxuYZiirglQagRg10Pr9XTrFyPSQeb6re5OxwiNuG4sjIQmY1eMBbiZNSgKSNERJCu/C9BxuUXYbzpI7e83pPr2QBnk/d0lhg0e+8wiI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=IvB6qgkT; arc=none smtp.client-ip=209.85.128.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="IvB6qgkT" Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-48370174e18so16334945e9.2 for ; Sat, 21 Feb 2026 01:40:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1771666805; x=1772271605; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=1SRt4pEujAjZL7YcRKGKgR1k7mcODZZuIAG7QjvJr7M=; b=IvB6qgkTqH4xbSr1HfZRYMlEK3a/1V9ZGn4Pk7iqcmU8+uudDOxyHwMZi1S27JHqBi jjNkQ/XRyLCpJNk0V+GWP2+DL2acsm4qgmxC3YQc9mh9w/q+z4Nsfgz8OQg5VLh4fIiq 175Y9A1iro18GnHyAkxVNrhCk63CaEvZIDUTMPGFptoJSRJC7bUY8Xz8ljWlz/upWAWi G7VEmLU/yc7rx4uldDZBbdZ9NFynK4taE8tiiDpi7U28qL1+WgExclCj9+w5vPf6Mxpa ojWF27CoC49te8Ypl58p/zV3xJPv8Du+6twoizl1lIm8pVu0+/0ctSckStpDvC6OmYt0 NELA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771666805; x=1772271605; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=1SRt4pEujAjZL7YcRKGKgR1k7mcODZZuIAG7QjvJr7M=; b=cDFYmNKUF/jZksNXCtbx81G/6J2E8nbsAGcPElLHZPificNAf8aUzAKdLclUSil2SI eh2xA2EFVpsj9CsavSsAHK1k3an7eodUNhgddCIQJlKWglVg/uZ4KTA6i6cnUT+dexd7 qbVTIhc/Vr6y+AI+l0CkFh3xWxDsYLSeXDgHTCgRg8NLgc5q0C+JA2Wldu148XZj8hEA n/CIT+pmhSvyEXXN8aYtq8LRZ20S0dx+kLGNDkuyn5c63hl1gO2c81pVfbxr/wL4hy4s orujpewTIDoizIvC/LBbegPFRmX6yY9gV+ewFEhZwMTv2eCS2GRgfD+gl9OoFfXohRYr z5FQ== X-Forwarded-Encrypted: i=1; AJvYcCXqoixoilwy0i0fVURleEACnJzNePHnHZuqkK5rK4NOiUUL09iTCnmgVwps7bwRdwclxXSvQT09SLXlGZw=@vger.kernel.org X-Gm-Message-State: AOJu0YyTGibXhefN1OkmMU6MFRJQL1C0y/yo9DIi1upujaKpKKBZTD8K 65HfQD0CwhRYEoQMd9GArU+Ldt2X6xMln0fUTHfg8Qi4mhHea6ddRR2t X-Gm-Gg: AZuq6aJHrTIcc69nPhYLUWSkhbGxogPbie69IFK+CJ/HHdsHDaWIZ8lPh6+zkCmbwRa ITDKXr4a7w+OCkqYn+NtuQn+nwINUkV0s3S1GzGW/7mst0apijQb4O9oNruADQDSIIWMg8+sHFf ojtTqUaYsGDhv6mNRYEmS0RMUb7d4F5/p7/avVkznM7C8yyd49OdQm6JxNPk/+G/daRZ3a6vjFy HcA4pRpFcnVYWZ5b5JpSSKiRCpviTz7+pT8cXU/NzDbo85/4KlDexmSRTIR4yNZ5lzaInlIkkQk +WT0zZfQOetp24IEgXJZRsJXWdCoAV3d5GaOp/r9mZR2tnMEUkAz7ewd+eh/UjdqSf3KdnAf8/2 bEoy3sgkQmnAE8dwOni1LNEbQBqMx+nPz06ixyWRxei+0X04jleihlVzWob/toeIYhNP4+VifgC 6THRHUBj+EDLDr1JJdPYlM8voSwkwjzKliyYyK00h3ZMN8Cht6O6KNfeYoJD4/znQA5uiieZoH2 xUPxe9M/yDptGyhYbs= X-Received: by 2002:a05:600c:608f:b0:477:7ae0:cd6e with SMTP id 5b1f17b1804b1-483a95bd7e8mr38778385e9.5.1771666805222; Sat, 21 Feb 2026 01:40:05 -0800 (PST) Received: from jernej-laptop.localnet (86-58-126-118.dynamic.telemach.net. [86.58.126.118]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-483a9caadd4sm41900045e9.11.2026.02.21.01.40.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Feb 2026 01:40:04 -0800 (PST) From: Jernej =?UTF-8?B?xaBrcmFiZWM=?= To: Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Chen-Yu Tsai , Samuel Holland , Richard Genoud Cc: Wentao Liang , Maxime Ripard , 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: Re: [PATCH 4/6] mtd: rawnand: sunxi: replace hard coded value by a define - take2 Date: Sat, 21 Feb 2026 10:23:33 +0100 Message-ID: <13952574.uLZWGnKmhe@jernej-laptop> In-Reply-To: <20260220161011.999642-5-richard.genoud@bootlin.com> References: <20260220161011.999642-1-richard.genoud@bootlin.com> <20260220161011.999642-5-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 Content-Type: text/plain; charset="utf-8" Dne petek, 20. februar 2026 ob 17:10:09 Srednjeevropski standardni =C4=8Das= je Richard Genoud napisal(a): > The user data length (4) has been replaced almost all over the file, but > 2 places were forgotten. >=20 > 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); >=20 > 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; >=20 > Fixes: 1be7ac78b72f ("mtd: rawnand: sunxi: Replace hard coded value by a = define") > Signed-off-by: Richard Genoud This doesn't really need Fixes tag since it's only refactoring. With that said: Reviewed-by: Jernej Skrabec Best regards, Jernej > --- > drivers/mtd/nand/raw/sunxi_nand.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) >=20 > diff --git a/drivers/mtd/nand/raw/sunxi_nand.c b/drivers/mtd/nand/raw/sun= xi_nand.c > index 99d305bbda53..5d925b59b618 100644 > --- a/drivers/mtd/nand/raw/sunxi_nand.c > +++ b/drivers/mtd/nand/raw/sunxi_nand.c > @@ -1051,7 +1051,7 @@ static void sunxi_nfc_hw_ecc_read_extra_oob(struct = nand_chip *nand, > { > struct mtd_info *mtd =3D nand_to_mtd(nand); > struct nand_ecc_ctrl *ecc =3D &nand->ecc; > - int offset =3D ((ecc->bytes + 4) * ecc->steps); > + int offset =3D ((ecc->bytes + USER_DATA_SZ) * ecc->steps); > int len =3D mtd->oobsize - offset; > =20 > if (len <=3D 0) > @@ -1747,7 +1747,7 @@ static int sunxi_nand_ooblayout_ecc(struct mtd_info= *mtd, int section, > if (section >=3D ecc->steps) > return -ERANGE; > =20 > - oobregion->offset =3D section * (ecc->bytes + USER_DATA_SZ) + 4; > + oobregion->offset =3D section * (ecc->bytes + USER_DATA_SZ) + USER_DATA= _SZ; > oobregion->length =3D ecc->bytes; > =20 > return 0; >=20