Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp2351474pxb; Mon, 20 Sep 2021 19:47:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx8oSRDBvV9uuZYSpTwvGWdTRyYrQrWU4Wb0KY3Bno6bPtQSE1V5Blm9hjIsryjkLg+DCgT X-Received: by 2002:a17:906:c18c:: with SMTP id g12mr32498275ejz.458.1632192454414; Mon, 20 Sep 2021 19:47:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632192454; cv=none; d=google.com; s=arc-20160816; b=u8KvtqHG1H1el7oB/lO9PJPojcPP5egtjh/8WRzdEziXzRisGV7Sv5mk4ugOjEfUos RKNAwumc4DUD3od2BDgoXCAWOoe+EiaB/2QEPAnYtz6fz78DLQbiNBIcQ16OdBpalz/h uPhGF/My6Zf1WeogSq6VtvMrQXB9PuHCQWT/7V91xMISdOTzlDhqcTdSiXzSijnVDKY9 EwexfjDVMtfsjF0G92N5ZnnHxWyJ4azSMS7TrWdsxjL00ib+qwpiq2jD67kXTwsmO1YF blwDROlLtwGbMj0rYGf9zoZyDwtV1PRRsfj4n7Eeu7v8lpOGV9vGuXI8Tfh1/6C3ja9i /p9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=adZZWDzhbBiUgD1uWjbmBtiMsywrBdew9PRUCtTBpTQ=; b=S7QI+mvhtcaQclxrTvKGqOJWKVIvftEUFe1Fo/LAOBcON2QwYZY7QkjmRui4maA+qS kHeytkG0JCGLcdjRg7mGEGwesEEdP4AS4rg9hHTyh2hFXsxdcNxNaG8fiyCoCtIu9NIS UOEGjMTJmBMyzxxaM8sUg/MpwLUnvGCwnQvciruWfmHfSXRRuneApJw8nQx3CZu2TgUn 4Lcdouc5IGmbIdsTAmWvO//6a138xbTrKctQlULYJHXIvRx3OoqFnIX1wEgbl7atsErZ GsMlP5X9pCA6nsekRPsgRasImOerA9cfcoGv+JbXXAiCrpGbRAaGRzUskU7spvImc6Od zkSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=yPS2mWs0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o23si13846104edi.283.2021.09.20.19.47.10; Mon, 20 Sep 2021 19:47:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=yPS2mWs0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352233AbhITS0n (ORCPT + 99 others); Mon, 20 Sep 2021 14:26:43 -0400 Received: from mail.kernel.org ([198.145.29.99]:40370 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377667AbhITSUT (ORCPT ); Mon, 20 Sep 2021 14:20:19 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id E1288632AE; Mon, 20 Sep 2021 17:23:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1632158604; bh=hjns1O5VBB1oEQxpCGhtIp+uuv+3hKCDt4L6L2WPSCw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yPS2mWs0XrirznLcLmz9hcsMXhV0657Fr0ho9Ii+BiQUs67NGvrm0Oojw3ypJRKLY +vUW+y0ZaUgrHAvWdL4jGH4mkZf9N1GtLkp+t3XMsFPJzXUF4h8VPaSVDoVAdHDDkA qdr8v+D2FB6pV23YDcIgrZkpFm+JWFLdB0rJ28Ek= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Ryan J. Barnett" , Miquel Raynal , Rob Herring , Sasha Levin Subject: [PATCH 5.4 233/260] dt-bindings: mtd: gpmc: Fix the ECC bytes vs. OOB bytes equation Date: Mon, 20 Sep 2021 18:44:11 +0200 Message-Id: <20210920163939.036554715@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210920163931.123590023@linuxfoundation.org> References: <20210920163931.123590023@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Miquel Raynal [ Upstream commit 778cb8e39f6ec252be50fc3850d66f3dcbd5dd5a ] "PAGESIZE / 512" is the number of ECC chunks. "ECC_BYTES" is the number of bytes needed to store a single ECC code. "2" is the space reserved by the bad block marker. "2 + (PAGESIZE / 512) * ECC_BYTES" should of course be lower or equal than the total number of OOB bytes, otherwise it won't fit. Fix the equation by substituting s/>=/<=/. Suggested-by: Ryan J. Barnett Signed-off-by: Miquel Raynal Acked-by: Rob Herring Link: https://lore.kernel.org/linux-mtd/20210610143945.3504781-1-miquel.raynal@bootlin.com Signed-off-by: Sasha Levin --- Documentation/devicetree/bindings/mtd/gpmc-nand.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/mtd/gpmc-nand.txt b/Documentation/devicetree/bindings/mtd/gpmc-nand.txt index 44919d48d241..c459f169a904 100644 --- a/Documentation/devicetree/bindings/mtd/gpmc-nand.txt +++ b/Documentation/devicetree/bindings/mtd/gpmc-nand.txt @@ -122,7 +122,7 @@ on various other factors also like; so the device should have enough free bytes available its OOB/Spare area to accommodate ECC for entire page. In general following expression helps in determining if given device can accommodate ECC syndrome: - "2 + (PAGESIZE / 512) * ECC_BYTES" >= OOBSIZE" + "2 + (PAGESIZE / 512) * ECC_BYTES" <= OOBSIZE" where OOBSIZE number of bytes in OOB/spare area PAGESIZE number of bytes in main-area of device page -- 2.30.2