diff mbox series

mtd: rawnand: oxnas: cleanup/simplify code

Message ID 20200724083825.GA31437@amd (mailing list archive)
State New, archived
Headers show
Series mtd: rawnand: oxnas: cleanup/simplify code | expand

Commit Message

Pavel Machek July 24, 2020, 8:38 a.m. UTC
Simplify oxnas_nand_probe.

Signed-off-by: Pavel Machek (CIP) <pavel@denx.de>

Comments

Neil Armstrong July 24, 2020, 10:01 a.m. UTC | #1
On 24/07/2020 10:38, Pavel Machek wrote:
> Simplify oxnas_nand_probe.
> 
> Signed-off-by: Pavel Machek (CIP) <pavel@denx.de>
> 
> diff --git a/drivers/mtd/nand/raw/oxnas_nand.c b/drivers/mtd/nand/raw/oxnas_nand.c
> index 8d0d76ad319d..f44947043e5a 100644
> --- a/drivers/mtd/nand/raw/oxnas_nand.c
> +++ b/drivers/mtd/nand/raw/oxnas_nand.c
> @@ -144,8 +144,7 @@ static int oxnas_nand_probe(struct platform_device *pdev)
>  		if (err)
>  			goto err_cleanup_nand;
>  
> -		oxnas->chips[oxnas->nchips] = chip;
> -		++oxnas->nchips;
> +		oxnas->chips[oxnas->nchips++] = chip;
>  	}
>  
>  	/* Exit if no chips found */
> 

Acked-by: Neil Armstrong <narmstrong@baylibre.com>
Miquel Raynal Sept. 7, 2020, 7:22 a.m. UTC | #2
On Fri, 2020-07-24 at 08:38:25 UTC, Pavel Machek wrote:
> Simplify oxnas_nand_probe.
> 
> Signed-off-by: Pavel Machek (CIP) <pavel@denx.de>
> Acked-by: Neil Armstrong <narmstrong@baylibre.com>

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

Miquel
diff mbox series

Patch

diff --git a/drivers/mtd/nand/raw/oxnas_nand.c b/drivers/mtd/nand/raw/oxnas_nand.c
index 8d0d76ad319d..f44947043e5a 100644
--- a/drivers/mtd/nand/raw/oxnas_nand.c
+++ b/drivers/mtd/nand/raw/oxnas_nand.c
@@ -144,8 +144,7 @@  static int oxnas_nand_probe(struct platform_device *pdev)
 		if (err)
 			goto err_cleanup_nand;
 
-		oxnas->chips[oxnas->nchips] = chip;
-		++oxnas->nchips;
+		oxnas->chips[oxnas->nchips++] = chip;
 	}
 
 	/* Exit if no chips found */