From patchwork Mon Oct 15 03:47:24 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Huang Shijie X-Patchwork-Id: 191367 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:4978:20e::2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 5D3CD2C0097 for ; Mon, 15 Oct 2012 02:47:08 +1100 (EST) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TNQNH-0001AW-6G; Sun, 14 Oct 2012 15:45:07 +0000 Received: from mail-da0-f49.google.com ([209.85.210.49]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TNQNA-0001AF-7U for linux-mtd@lists.infradead.org; Sun, 14 Oct 2012 15:45:02 +0000 Received: by mail-da0-f49.google.com with SMTP id q27so2259057daj.36 for ; Sun, 14 Oct 2012 08:44:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer; bh=FeDkzMce91xrraEk7OHg0zh0BlBCRNVOA9657nOYpz4=; b=nO4jz1LKGPtgItBZE89KyztOx6ekA5NIcvTF8uDQZ1LowehKE0ZVBeWauZ1p2NpVNr ko2h48VUjO3IA5k02PS/yc5iguIGNYIxcshQubzww/4tXxOu10nA9VIBEgbwhAU7nXCf khQ7kzs/P/yu0WAgpIS9yMBHIIxm5b/MLuUrekwjBymJAv+3jxzya0kXJanxjWrSzooO M+l7jxmzyh4xjGNYReVvzIuLFY7NGvk4dTzyKvNYyc7cw5uVjN5iPtjNKcDo4VQsI8CO lT1d94yh6j7diJY9NByyzJwFKUd+3mhzJpkx+VbC2Wun+luG57rTiU0GjapnPIO3LEOP wRlQ== Received: by 10.68.248.1 with SMTP id yi1mr30296679pbc.93.1350229497075; Sun, 14 Oct 2012 08:44:57 -0700 (PDT) Received: from localhost.localdomain ([218.79.29.169]) by mx.google.com with ESMTPS id c1sm301520pav.23.2012.10.14.08.44.53 (version=SSLv3 cipher=OTHER); Sun, 14 Oct 2012 08:44:55 -0700 (PDT) From: Huang Shijie To: dwmw2@infradead.org Subject: [PATCH] mtd: use the NAND_STATUS_FAIL to replace the hardcode Date: Sun, 14 Oct 2012 23:47:24 -0400 Message-Id: <1350272844-21866-1-git-send-email-shijie8@gmail.com> X-Mailer: git-send-email 1.7.4.4 X-Spam-Note: CRM114 invocation failed X-Spam-Score: 0.7 (/) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.210.49 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (shijie8[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record 3.2 DATE_IN_FUTURE_12_24 Date: is 12 to 24 hours after Received: date 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (shijie8[at]gmail.com) -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Cc: Huang Shijie , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, dedekind1@gmail.com X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-mtd-bounces@lists.infradead.org Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Use the NAND_STATUS_FAIL to replace the hardcode "0x01", which make the code more readable. Signed-off-by: Huang Shijie Acked-by: Brian Norris --- drivers/mtd/nand/nand_base.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c index d5ece6e..4569174 100644 --- a/drivers/mtd/nand/nand_base.c +++ b/drivers/mtd/nand/nand_base.c @@ -899,7 +899,7 @@ static int __nand_unlock(struct mtd_info *mtd, loff_t ofs, /* Call wait ready function */ status = chip->waitfunc(mtd, chip); /* See if device thinks it succeeded */ - if (status & 0x01) { + if (status & NAND_STATUS_FAIL) { pr_debug("%s: error status = 0x%08x\n", __func__, status); ret = -EIO; @@ -1004,7 +1004,7 @@ int nand_lock(struct mtd_info *mtd, loff_t ofs, uint64_t len) /* Call wait ready function */ status = chip->waitfunc(mtd, chip); /* See if device thinks it succeeded */ - if (status & 0x01) { + if (status & NAND_STATUS_FAIL) { pr_debug("%s: error status = 0x%08x\n", __func__, status); ret = -EIO;