From: Richard Weinberger Date: Sun, 17 Sep 2017 14:13:52 +0000 (+0200) Subject: mtd: spi-nor: Kill check with no effect X-Git-Tag: v4.15-rc1~25^2~15^2~34 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=90d4fa4540f16df552b4bac480a032552e594fc3;p=thirdparty%2Flinux.git mtd: spi-nor: Kill check with no effect header.minor is of type u8 and cannot be negative. Detected by CoverityScan CID#1417858 ("Integer handling issues") Fixes: f384b352cbf0 ("mtd: spi-nor: parse Serial Flash Discoverable Parameters (SFDP) tables") Signed-off-by: Richard Weinberger Signed-off-by: Cyrille Pitchen --- diff --git a/drivers/mtd/spi-nor/spi-nor.c b/drivers/mtd/spi-nor/spi-nor.c index 19c000722cbc8..33f6fc1b0eab5 100644 --- a/drivers/mtd/spi-nor/spi-nor.c +++ b/drivers/mtd/spi-nor/spi-nor.c @@ -2288,8 +2288,7 @@ static int spi_nor_parse_sfdp(struct spi_nor *nor, /* Check the SFDP header version. */ if (le32_to_cpu(header.signature) != SFDP_SIGNATURE || - header.major != SFDP_JESD216_MAJOR || - header.minor < SFDP_JESD216_MINOR) + header.major != SFDP_JESD216_MAJOR) return -EINVAL; /*