projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2e8f56f
)
mtd: rawnand: jedec: Use intermediate variables to improve readability
author
Miquel Raynal
<miquel.raynal@bootlin.com>
Tue, 28 Apr 2020 09:43:02 +0000
(11:43 +0200)
committer
Miquel Raynal
<miquel.raynal@bootlin.com>
Mon, 11 May 2020 07:51:41 +0000
(09:51 +0200)
Before reworking a little bit the JEDEC detection code, let's
clean the coding style of an if statement to improve readability.
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Link:
https://lore.kernel.org/linux-mtd/20200428094302.14624-10-miquel.raynal@bootlin.com
drivers/mtd/nand/raw/nand_jedec.c
patch
|
blob
|
history
diff --git
a/drivers/mtd/nand/raw/nand_jedec.c
b/drivers/mtd/nand/raw/nand_jedec.c
index 0cd322a8be242d648e0a8017375cd814f5bbbb54..15937e02c64f19a7b1f41e4a0d8e08bed91f6638 100644
(file)
--- a/
drivers/mtd/nand/raw/nand_jedec.c
+++ b/
drivers/mtd/nand/raw/nand_jedec.c
@@
-30,6
+30,7
@@
int nand_jedec_detect(struct nand_chip *chip)
int jedec_version = 0;
char id[5];
int i, val, ret;
+ u16 crc;
memorg = nanddev_get_memorg(&chip->base);
@@
-56,8
+57,8
@@
int nand_jedec_detect(struct nand_chip *chip)
goto free_jedec_param_page;
}
- if (onfi_crc16(ONFI_CRC_BASE, (uint8_t *)p, 510) ==
-
le16_to_cpu(p->crc))
+ crc = onfi_crc16(ONFI_CRC_BASE, (u8 *)p, 510);
+
if (crc ==
le16_to_cpu(p->crc))
break;
}