From patchwork Thu Jun 4 14:24:59 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: roel kluin X-Patchwork-Id: 28100 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by bilbo.ozlabs.org (Postfix) with ESMTPS id B6C8EB6F34 for ; Thu, 4 Jun 2009 22:26:30 +1000 (EST) Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.69 #1 (Red Hat Linux)) id 1MCC0D-000899-5v; Thu, 04 Jun 2009 12:25:01 +0000 Received: from mail-ew0-f221.google.com ([209.85.219.221]) by bombadil.infradead.org with esmtp (Exim 4.69 #1 (Red Hat Linux)) id 1MCC03-00087I-OY for linux-mtd@lists.infradead.org; Thu, 04 Jun 2009 12:24:58 +0000 Received: by ewy21 with SMTP id 21so242465ewy.18 for ; Thu, 04 Jun 2009 05:24:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:cc:subject:content-type :content-transfer-encoding; bh=NS3qzw8LUNxdEO7vEKFkbz7RwYfkqNXAe+nmuIWdF+w=; b=jQ3cw3aIBHb2bdG3EZBFVOtYOSxcnSsME1QHnAp7HIpOZArDcwTUSnjS6M8pm76gw6 lBaqSRPLCcVzXBB0o1z6dwabKkP2p0vj8tUH7eL9ivIEVAXYgF1sD5q37dirapQKOvjP GOs0Xh2ZcBZc/jIuqOnmp6GOaVFtwg9Dl2TAI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :content-type:content-transfer-encoding; b=dakXBqYcqF+CMjNPpMHzrxA2ro0gwxVRL+zF/pLUPtDlAf8s8ZbrdZQCv4o/BbElMd z4/l9aNMDhTkm1xgXCRtlke3ZFbrcnVI2txDASB9p1NHb8KZK93cPioOx2DMeOqHgsec gQWAuJ2HsrBScgNk14q/7Kx//QkxtBnUCAW+A= Received: by 10.216.12.67 with SMTP id 45mr741101wey.218.1244118289770; Thu, 04 Jun 2009 05:24:49 -0700 (PDT) Received: from ?192.168.1.2? (d133062.upc-d.chello.nl [213.46.133.62]) by mx.google.com with ESMTPS id p37sm6856553gvf.12.2009.06.04.05.24.48 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 04 Jun 2009 05:24:49 -0700 (PDT) Message-ID: <4A27D93B.9020906@gmail.com> Date: Thu, 04 Jun 2009 16:24:59 +0200 From: Roel Kluin User-Agent: Thunderbird 2.0.0.21 (X11/20090320) MIME-Version: 1.0 To: dwmw2@infradead.org Subject: [PATCH] mtd/nand: max_retries off by one X-Spam-Score: 0.0 (/) Cc: Andrew Morton , linux-mtd@lists.infradead.org X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-mtd-bounces@lists.infradead.org Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org with `while (max_retries-- > 0)' max_retries reaches -1 after the loop. Signed-off-by: Roel Kluin diff --git a/drivers/mtd/nand/mxc_nand.c b/drivers/mtd/nand/mxc_nand.c index 40c2608..b9706ad 100644 --- a/drivers/mtd/nand/mxc_nand.c +++ b/drivers/mtd/nand/mxc_nand.c @@ -192,7 +192,7 @@ static void wait_op_done(struct mxc_nand_host *host, int max_retries, } udelay(1); } - if (max_retries <= 0) + if (max_retries < 0) DEBUG(MTD_DEBUG_LEVEL0, "%s(%d): INT not set\n", __func__, param); }