From: Josh Wu Date: Mon, 25 Jan 2016 06:06:35 +0000 (+0800) Subject: atmel_nand: use the definition: PMECC_OOB_RESERVED_BYTES instead magic number X-Git-Tag: v2016.03-rc1~1^2~6 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=422b49e2895ef61a1cc454aca6dd79a8e2279eff;p=u-boot atmel_nand: use the definition: PMECC_OOB_RESERVED_BYTES instead magic number As atmel_nand_ecc.h is sync with v4.1 kernel, which adds the PMECC_OOB_RESERVED_BYTES. So use it in the driver. Signed-off-by: Josh Wu Reviewed-by: Andreas Bießmann Signed-off-by: Wenyou Yang --- diff --git a/drivers/mtd/nand/atmel_nand.c b/drivers/mtd/nand/atmel_nand.c index 852883bfb2..73fd403886 100644 --- a/drivers/mtd/nand/atmel_nand.c +++ b/drivers/mtd/nand/atmel_nand.c @@ -901,7 +901,7 @@ static int atmel_pmecc_nand_init_params(struct nand_chip *nand, return -EINVAL; } - if (nand->ecc.bytes > mtd->oobsize - 2) { + if (nand->ecc.bytes > mtd->oobsize - PMECC_OOB_RESERVED_BYTES) { dev_err(host->dev, "No room for ECC bytes\n"); return -EINVAL; }