From patchwork Tue Feb 10 22:43:00 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: roel kluin X-Patchwork-Id: 22894 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@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 ozlabs.org (Postfix) with ESMTPS id 6A13EDDDA4 for ; Wed, 11 Feb 2009 09:46:00 +1100 (EST) Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.69 #1 (Red Hat Linux)) id 1LX1K1-0006xo-QD; Tue, 10 Feb 2009 22:43:18 +0000 Received: from ey-out-1920.google.com ([74.125.78.144]) by bombadil.infradead.org with esmtp (Exim 4.69 #1 (Red Hat Linux)) id 1LX1Jo-0006wy-2n for linux-mtd@lists.infradead.org; Tue, 10 Feb 2009 22:43:07 +0000 Received: by ey-out-1920.google.com with SMTP id 4so18204eyg.24 for ; Tue, 10 Feb 2009 14:43:01 -0800 (PST) Received: by 10.210.119.16 with SMTP id r16mr2677962ebc.91.1234305781093; Tue, 10 Feb 2009 14:43:01 -0800 (PST) Received: from ?192.168.1.115? (d133062.upc-d.chello.nl [213.46.133.62]) by mx.google.com with ESMTPS id 34sm445378nfu.77.2009.02.10.14.43.00 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 10 Feb 2009 14:43:00 -0800 (PST) Message-ID: <499202F4.3020408@gmail.com> Date: Tue, 10 Feb 2009 23:43:00 +0100 From: Roel Kluin User-Agent: Thunderbird 2.0.0.18 (X11/20081105) MIME-Version: 1.0 To: s.hauer@pengutronix.de, David.Woodhouse@intel.com Subject: [PATCH] max_retries reaches -1, not 0 X-Spam-Score: 0.0 (/) Cc: linux-mtd@lists.infradead.org X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.9 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, not 0, so we shouldn't DEBUG() on a max_retries of 0. Signed-off-by: Roel Kluin Acked-by: Sascha Hauer diff --git a/drivers/mtd/nand/mxc_nand.c b/drivers/mtd/nand/mxc_nand.c index 21fd4f1..5c34148 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); }