2020-09-21 08:06:01

by Liu Shixin

[permalink] [raw]
Subject: [PATCH -next] mtd: onenand_base: simplify the return expression of onenand_transfer_auto_oob

Simplify the return expression.

Signed-off-by: Liu Shixin <[email protected]>
---
drivers/mtd/nand/onenand/onenand_base.c | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/mtd/nand/onenand/onenand_base.c b/drivers/mtd/nand/onenand/onenand_base.c
index ec18ade33262..188b8061e1f7 100644
--- a/drivers/mtd/nand/onenand/onenand_base.c
+++ b/drivers/mtd/nand/onenand/onenand_base.c
@@ -1052,16 +1052,11 @@ static int onenand_transfer_auto_oob(struct mtd_info *mtd, uint8_t *buf, int col
int thislen)
{
struct onenand_chip *this = mtd->priv;
- int ret;

this->read_bufferram(mtd, ONENAND_SPARERAM, this->oob_buf, 0,
mtd->oobsize);
- ret = mtd_ooblayout_get_databytes(mtd, buf, this->oob_buf,
- column, thislen);
- if (ret)
- return ret;
-
- return 0;
+ return mtd_ooblayout_get_databytes(mtd, buf, this->oob_buf,
+ column, thislen);
}

/**
--
2.25.1


2020-09-28 15:01:18

by Miquel Raynal

[permalink] [raw]
Subject: Re: [PATCH -next] mtd: onenand_base: simplify the return expression of onenand_transfer_auto_oob

On Mon, 2020-09-21 at 08:24:41 UTC, Liu Shixin wrote:
> Simplify the return expression.
>
> Signed-off-by: Liu Shixin <[email protected]>

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next, thanks.

Miquel