mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] mtd: use the NAND_STATUS_FAIL to replace the hardcode
@ 2012-10-15  3:47 Huang Shijie
  2012-10-24  6:14 ` Huang Shijie
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Huang Shijie @ 2012-10-15  3:47 UTC (permalink / raw)
  To: dwmw2; +Cc: dedekind1, linux-mtd, linux-kernel, Huang Shijie

Use the NAND_STATUS_FAIL to replace the hardcode "0x01",
which make the code more readable.

Signed-off-by: Huang Shijie <shijie8@gmail.com>
---
 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;
-- 
1.7.4.4


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] mtd: use the NAND_STATUS_FAIL to replace the hardcode
  2012-10-15  3:47 [PATCH] mtd: use the NAND_STATUS_FAIL to replace the hardcode Huang Shijie
@ 2012-10-24  6:14 ` Huang Shijie
  2012-10-25 16:07 ` Brian Norris
  2012-10-26 14:22 ` Artem Bityutskiy
  2 siblings, 0 replies; 4+ messages in thread
From: Huang Shijie @ 2012-10-24  6:14 UTC (permalink / raw)
  To: dwmw2; +Cc: dedekind1, linux-mtd, linux-kernel, Huang Shijie

ping

On Mon, Oct 15, 2012 at 11:47 AM, Huang Shijie <shijie8@gmail.com> wrote:
> Use the NAND_STATUS_FAIL to replace the hardcode "0x01",
> which make the code more readable.
>
> Signed-off-by: Huang Shijie <shijie8@gmail.com>
> ---
>  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;
> --
> 1.7.4.4
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] mtd: use the NAND_STATUS_FAIL to replace the hardcode
  2012-10-15  3:47 [PATCH] mtd: use the NAND_STATUS_FAIL to replace the hardcode Huang Shijie
  2012-10-24  6:14 ` Huang Shijie
@ 2012-10-25 16:07 ` Brian Norris
  2012-10-26 14:22 ` Artem Bityutskiy
  2 siblings, 0 replies; 4+ messages in thread
From: Brian Norris @ 2012-10-25 16:07 UTC (permalink / raw)
  To: Huang Shijie; +Cc: dwmw2, linux-mtd, linux-kernel, dedekind1

FWIW

On Sun, Oct 14, 2012 at 8:47 PM, Huang Shijie <shijie8@gmail.com> wrote:
> Use the NAND_STATUS_FAIL to replace the hardcode "0x01",
> which make the code more readable.
>
> Signed-off-by: Huang Shijie <shijie8@gmail.com>

Acked-by: Brian Norris <computersforpeace@gmail.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] mtd: use the NAND_STATUS_FAIL to replace the hardcode
  2012-10-15  3:47 [PATCH] mtd: use the NAND_STATUS_FAIL to replace the hardcode Huang Shijie
  2012-10-24  6:14 ` Huang Shijie
  2012-10-25 16:07 ` Brian Norris
@ 2012-10-26 14:22 ` Artem Bityutskiy
  2 siblings, 0 replies; 4+ messages in thread
From: Artem Bityutskiy @ 2012-10-26 14:22 UTC (permalink / raw)
  To: Huang Shijie; +Cc: dwmw2, linux-mtd, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 282 bytes --]

On Sun, 2012-10-14 at 23:47 -0400, Huang Shijie wrote:
> Use the NAND_STATUS_FAIL to replace the hardcode "0x01",
> which make the code more readable.
> 
> Signed-off-by: Huang Shijie <shijie8@gmail.com>

Pushed to l2-mtd.git, thanks!

-- 
Best Regards,
Artem Bityutskiy

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-10-26 14:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-15  3:47 [PATCH] mtd: use the NAND_STATUS_FAIL to replace the hardcode Huang Shijie
2012-10-24  6:14 ` Huang Shijie
2012-10-25 16:07 ` Brian Norris
2012-10-26 14:22 ` Artem Bityutskiy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome