mtd: rawnand: jedec: Use intermediate variables to improve readability
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
This commit is contained in:
parent
2e8f56f2a9
commit
432ab89d30
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user