From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kb1xM-00054R-3L for barebox@lists.infradead.org; Fri, 06 Nov 2020 13:39:17 +0000 From: Sascha Hauer Date: Fri, 6 Nov 2020 14:38:48 +0100 Message-Id: <20201106133900.2656-15-s.hauer@pengutronix.de> In-Reply-To: <20201106133900.2656-1-s.hauer@pengutronix.de> References: <20201106133900.2656-1-s.hauer@pengutronix.de> MIME-Version: 1.0 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "barebox" Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: [PATCH 14/26] mtd: nand: omap_gpmc: Fix wrong length check To: Barebox List We may only write more characters when there's actually something left to write. Fix the wrong check. Signed-off-by: Sascha Hauer --- drivers/mtd/nand/nand_omap_gpmc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mtd/nand/nand_omap_gpmc.c b/drivers/mtd/nand/nand_omap_gpmc.c index d10ba5a8a8..670eba4206 100644 --- a/drivers/mtd/nand/nand_omap_gpmc.c +++ b/drivers/mtd/nand/nand_omap_gpmc.c @@ -632,7 +632,7 @@ static void omap_write_buf_pref(struct nand_chip *nand_chip, gpmc_prefetch_enable(info->gpmc_cs, PREFETCH_FIFOTHRESHOLD_MAX, 0x0, len, 0x1); - while (len >= 0) { + while (len) { w_count = readl(info->gpmc_base + GPMC_PREFETCH_STATUS); w_count = GPMC_PREFETCH_STATUS_FIFO_CNT(w_count); w_count = w_count >> 2; -- 2.20.1 _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox