Received: by 2002:a05:6520:4d:b0:139:a872:a4c9 with SMTP id i13csp2560953lkm; Mon, 20 Sep 2021 18:45:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJylw97RThD5iGXouCHQir8trmNwLR1q6uVOMrqTsi6YNUrMvV2Z5hdawKIFq9oSbmZzpuLh X-Received: by 2002:a02:ccb4:: with SMTP id t20mr16480751jap.84.1632188633233; Mon, 20 Sep 2021 18:43:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632188633; cv=none; d=google.com; s=arc-20160816; b=IOVIcnlRope8AQEsAURcLzhd2IMiSFprAPpNFNcTzR37OdKBYDRyunqSmLFNdUb3+7 lrFZNszWUHsW7JAE9urspzu0ihuLefFRb4JxVgzGjkXgXNM3PFZBAcaLb4D9UA08DDr7 8zKtj2Mo4L0KuOiBqRGTCjoikxpjKQJtryDK/bnPpwNvGgZXozJd8uHaEEIb4vZYcxpN SZMt9JUfyvrCZW29Q/bzSjw0VoMtH/qvv6jO0k5ExA7QpgCaHI4QMInL26xnjvzRfS7g i/Sq91ZVtjNgQxzhcNPY8ypn+rXh0ONT6lgZharLnU/ncGhZSyPSk22kP+ynGz+f2KTj mxYA== 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=IWaMP5tYEYbIf7MZS2FPzdSQ9Dr3PNZ9qzyumWhuxX4=; b=HYMRgNy6YCBUV/TQvVzrUtIF/Y6KIiCWq92VQ9Dg7QOvq1fWPWOo9NWYk+1TPlNfbM IELjeahPlxj28q+Q7KMIJ+JKYb/drnfkhxjEyon/61mJD8/3KGloKDvNwFdglVUQGSwr sFLxRrv+EgXONe4zmKT2L2BYGT8+vTKrHfGaa3SmBNCVbkcFVQqOdE0Fe6etGcEyrelk 1+HzQf84tAM3czS6j6WnJf2gsNyohOm5O0Ip+PSchaVYA4z2Dc2mca5G7eOwFMIrOMoz SQ8i5lEMmaKo6IzvBq9n6stpvKwDVvYJhxKv4pCYHxEtixzXTog+Kj/i3soPTnQhHuFU NEAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=J16quz47; 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 a17si7395539jar.110.2021.09.20.18.43.41; Mon, 20 Sep 2021 18:43:53 -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=J16quz47; 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 S244647AbhITQ5W (ORCPT + 99 others); Mon, 20 Sep 2021 12:57:22 -0400 Received: from mail.kernel.org ([198.145.29.99]:38366 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243500AbhITQwn (ORCPT ); Mon, 20 Sep 2021 12:52:43 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C6EEA6134F; Mon, 20 Sep 2021 16:50:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1632156602; bh=ltZZyCsnjnNoe+sQ9hulck8kwCSo5dN6HI0l2iLLg8g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=J16quz47XA1yaL74MPBytqTEEGqBM1phGCF6rRXMyyv1ENnZ55kVYvgoG/xw2N4Q4 ffx13ImtVRB1f4C8x0avhKvJCZ5sFOThaDDUiZn6a42bS/ZUdQAqICXJmFh4CZrZht etRD2NXNaZceJMESYU/igHThG+BU6MOBWxpfr4Jc= 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 4.4 127/133] dt-bindings: mtd: gpmc: Fix the ECC bytes vs. OOB bytes equation Date: Mon, 20 Sep 2021 18:43:25 +0200 Message-Id: <20210920163916.780183161@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210920163912.603434365@linuxfoundation.org> References: <20210920163912.603434365@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 fb733c4e1c11..3a58fdf0c566 100644 --- a/Documentation/devicetree/bindings/mtd/gpmc-nand.txt +++ b/Documentation/devicetree/bindings/mtd/gpmc-nand.txt @@ -112,7 +112,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