* [PATCH -next] mtd: rawnand: simplify the cs553x_write_ctrl_byte()
@ 2020-12-09 9:31 ` Zheng Yongjun
0 siblings, 0 replies; 4+ messages in thread
From: Zheng Yongjun @ 2020-12-09 9:31 UTC (permalink / raw)
To: miquel.raynal, richard, vigneshr, linux-mtd, linux-kernel; +Cc: Zheng Yongjun
Simplify the return expression.
Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
---
drivers/mtd/nand/raw/cs553x_nand.c | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)
diff --git a/drivers/mtd/nand/raw/cs553x_nand.c b/drivers/mtd/nand/raw/cs553x_nand.c
index 282203debd0c..a616aaa2e3dc 100644
--- a/drivers/mtd/nand/raw/cs553x_nand.c
+++ b/drivers/mtd/nand/raw/cs553x_nand.c
@@ -105,17 +105,12 @@ static int cs553x_write_ctrl_byte(struct cs553x_nand_controller *cs553x,
u32 ctl, u8 data)
{
u8 status;
- int ret;
writeb(ctl, cs553x->mmio + MM_NAND_CTL);
writeb(data, cs553x->mmio + MM_NAND_IO);
- ret = readb_poll_timeout_atomic(cs553x->mmio + MM_NAND_STS, status,
- !(status & CS_NAND_CTLR_BUSY), 1,
- 100000);
- if (ret)
- return ret;
-
- return 0;
+ return readb_poll_timeout_atomic(cs553x->mmio + MM_NAND_STS, status,
+ !(status & CS_NAND_CTLR_BUSY), 1,
+ 100000);
}
static void cs553x_data_in(struct cs553x_nand_controller *cs553x, void *buf,
--
2.22.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH -next] mtd: rawnand: simplify the cs553x_write_ctrl_byte()
@ 2020-12-09 9:31 ` Zheng Yongjun
0 siblings, 0 replies; 4+ messages in thread
From: Zheng Yongjun @ 2020-12-09 9:31 UTC (permalink / raw)
To: miquel.raynal, richard, vigneshr, linux-mtd, linux-kernel; +Cc: Zheng Yongjun
Simplify the return expression.
Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
---
drivers/mtd/nand/raw/cs553x_nand.c | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)
diff --git a/drivers/mtd/nand/raw/cs553x_nand.c b/drivers/mtd/nand/raw/cs553x_nand.c
index 282203debd0c..a616aaa2e3dc 100644
--- a/drivers/mtd/nand/raw/cs553x_nand.c
+++ b/drivers/mtd/nand/raw/cs553x_nand.c
@@ -105,17 +105,12 @@ static int cs553x_write_ctrl_byte(struct cs553x_nand_controller *cs553x,
u32 ctl, u8 data)
{
u8 status;
- int ret;
writeb(ctl, cs553x->mmio + MM_NAND_CTL);
writeb(data, cs553x->mmio + MM_NAND_IO);
- ret = readb_poll_timeout_atomic(cs553x->mmio + MM_NAND_STS, status,
- !(status & CS_NAND_CTLR_BUSY), 1,
- 100000);
- if (ret)
- return ret;
-
- return 0;
+ return readb_poll_timeout_atomic(cs553x->mmio + MM_NAND_STS, status,
+ !(status & CS_NAND_CTLR_BUSY), 1,
+ 100000);
}
static void cs553x_data_in(struct cs553x_nand_controller *cs553x, void *buf,
--
2.22.0
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH -next] mtd: rawnand: simplify the cs553x_write_ctrl_byte()
2020-12-09 9:31 ` Zheng Yongjun
@ 2020-12-10 21:19 ` Miquel Raynal
-1 siblings, 0 replies; 4+ messages in thread
From: Miquel Raynal @ 2020-12-10 21:19 UTC (permalink / raw)
To: Zheng Yongjun; +Cc: richard, vigneshr, linux-mtd, linux-kernel
Hi Yongjun,
Zheng Yongjun <zhengyongjun3@huawei.com> wrote on Wed, 9 Dec 2020
17:31:03 +0800:
> Simplify the return expression.
>
> Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
> ---
> drivers/mtd/nand/raw/cs553x_nand.c | 11 +++--------
> 1 file changed, 3 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/mtd/nand/raw/cs553x_nand.c b/drivers/mtd/nand/raw/cs553x_nand.c
> index 282203debd0c..a616aaa2e3dc 100644
> --- a/drivers/mtd/nand/raw/cs553x_nand.c
> +++ b/drivers/mtd/nand/raw/cs553x_nand.c
> @@ -105,17 +105,12 @@ static int cs553x_write_ctrl_byte(struct cs553x_nand_controller *cs553x,
> u32 ctl, u8 data)
> {
> u8 status;
> - int ret;
>
> writeb(ctl, cs553x->mmio + MM_NAND_CTL);
> writeb(data, cs553x->mmio + MM_NAND_IO);
> - ret = readb_poll_timeout_atomic(cs553x->mmio + MM_NAND_STS, status,
> - !(status & CS_NAND_CTLR_BUSY), 1,
> - 100000);
> - if (ret)
> - return ret;
> -
> - return 0;
> + return readb_poll_timeout_atomic(cs553x->mmio + MM_NAND_STS, status,
> + !(status & CS_NAND_CTLR_BUSY), 1,
> + 100000);
> }
>
> static void cs553x_data_in(struct cs553x_nand_controller *cs553x, void *buf,
Sorry but this brings no value and I kind of personally dislike commits
darkening git blames for almost no reason, so if you don't mind I would
like to avoid such change.
Thanks,
Miquèl
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH -next] mtd: rawnand: simplify the cs553x_write_ctrl_byte()
@ 2020-12-10 21:19 ` Miquel Raynal
0 siblings, 0 replies; 4+ messages in thread
From: Miquel Raynal @ 2020-12-10 21:19 UTC (permalink / raw)
To: Zheng Yongjun; +Cc: richard, linux-mtd, vigneshr, linux-kernel
Hi Yongjun,
Zheng Yongjun <zhengyongjun3@huawei.com> wrote on Wed, 9 Dec 2020
17:31:03 +0800:
> Simplify the return expression.
>
> Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
> ---
> drivers/mtd/nand/raw/cs553x_nand.c | 11 +++--------
> 1 file changed, 3 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/mtd/nand/raw/cs553x_nand.c b/drivers/mtd/nand/raw/cs553x_nand.c
> index 282203debd0c..a616aaa2e3dc 100644
> --- a/drivers/mtd/nand/raw/cs553x_nand.c
> +++ b/drivers/mtd/nand/raw/cs553x_nand.c
> @@ -105,17 +105,12 @@ static int cs553x_write_ctrl_byte(struct cs553x_nand_controller *cs553x,
> u32 ctl, u8 data)
> {
> u8 status;
> - int ret;
>
> writeb(ctl, cs553x->mmio + MM_NAND_CTL);
> writeb(data, cs553x->mmio + MM_NAND_IO);
> - ret = readb_poll_timeout_atomic(cs553x->mmio + MM_NAND_STS, status,
> - !(status & CS_NAND_CTLR_BUSY), 1,
> - 100000);
> - if (ret)
> - return ret;
> -
> - return 0;
> + return readb_poll_timeout_atomic(cs553x->mmio + MM_NAND_STS, status,
> + !(status & CS_NAND_CTLR_BUSY), 1,
> + 100000);
> }
>
> static void cs553x_data_in(struct cs553x_nand_controller *cs553x, void *buf,
Sorry but this brings no value and I kind of personally dislike commits
darkening git blames for almost no reason, so if you don't mind I would
like to avoid such change.
Thanks,
Miquèl
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-12-10 21:23 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-09 9:31 [PATCH -next] mtd: rawnand: simplify the cs553x_write_ctrl_byte() Zheng Yongjun
2020-12-09 9:31 ` Zheng Yongjun
2020-12-10 21:19 ` Miquel Raynal
2020-12-10 21:19 ` Miquel Raynal
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.