CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Jungseung Lee <js07.lee(a)samsung.com>
CC: Tudor Ambarus <tudor.ambarus(a)microchip.com>
CC: Michael Walle <michael(a)walle.cc>
tree:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: deacdb3e3979979016fcd0ffd518c320a62ad166
commit: 2d284768b49bcf1c643c08a201ff2161041178ef mtd: spi-nor: Add generic formula for SR
block protection handling
date: 4 months ago
:::::: branch date: 5 hours ago
:::::: commit date: 4 months ago
config: h8300-randconfig-m031-20200731 (attached as .config)
compiler: h8300-linux-gcc (GCC) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
New smatch warnings:
drivers/mtd/spi-nor/core.c:1550 spi_nor_get_min_prot_length_sr() warn: should
'nor->info->sector_size << (bp_slots_needed - bp_slots)' be a 64 bit
type?
Old smatch warnings:
drivers/mtd/spi-nor/core.c:1356 spi_nor_init_erase_cmd_list() warn: passing a valid
pointer to 'PTR_ERR'
drivers/mtd/spi-nor/core.c:1369 spi_nor_init_erase_cmd_list() warn: passing a valid
pointer to 'PTR_ERR'
#
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit...
git remote add linus
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git remote update linus
git checkout 2d284768b49bcf1c643c08a201ff2161041178ef
vim +1550 drivers/mtd/spi-nor/core.c
b199489d37b21c5 drivers/mtd/spi-nor/spi-nor.c Huang Shijie 2014-02-24 1538
2d284768b49bcf1 drivers/mtd/spi-nor/core.c Jungseung Lee 2020-03-18 1539 static u64
spi_nor_get_min_prot_length_sr(struct spi_nor *nor)
2d284768b49bcf1 drivers/mtd/spi-nor/core.c Jungseung Lee 2020-03-18 1540 {
2d284768b49bcf1 drivers/mtd/spi-nor/core.c Jungseung Lee 2020-03-18 1541 unsigned
int bp_slots, bp_slots_needed;
2d284768b49bcf1 drivers/mtd/spi-nor/core.c Jungseung Lee 2020-03-18 1542 u8 mask =
SR_BP2 | SR_BP1 | SR_BP0;
2d284768b49bcf1 drivers/mtd/spi-nor/core.c Jungseung Lee 2020-03-18 1543
2d284768b49bcf1 drivers/mtd/spi-nor/core.c Jungseung Lee 2020-03-18 1544 /* Reserved
one for "protect none" and one for "protect all". */
2d284768b49bcf1 drivers/mtd/spi-nor/core.c Jungseung Lee 2020-03-18 1545 bp_slots =
(mask >> SR_BP_SHIFT) + 1 - 2;
2d284768b49bcf1 drivers/mtd/spi-nor/core.c Jungseung Lee 2020-03-18 1546
bp_slots_needed = ilog2(nor->info->n_sectors);
2d284768b49bcf1 drivers/mtd/spi-nor/core.c Jungseung Lee 2020-03-18 1547
2d284768b49bcf1 drivers/mtd/spi-nor/core.c Jungseung Lee 2020-03-18 1548 if
(bp_slots_needed > bp_slots)
2d284768b49bcf1 drivers/mtd/spi-nor/core.c Jungseung Lee 2020-03-18 1549 return
nor->info->sector_size <<
2d284768b49bcf1 drivers/mtd/spi-nor/core.c Jungseung Lee 2020-03-18 @1550
(bp_slots_needed - bp_slots);
2d284768b49bcf1 drivers/mtd/spi-nor/core.c Jungseung Lee 2020-03-18 1551 else
2d284768b49bcf1 drivers/mtd/spi-nor/core.c Jungseung Lee 2020-03-18 1552 return
nor->info->sector_size;
2d284768b49bcf1 drivers/mtd/spi-nor/core.c Jungseung Lee 2020-03-18 1553 }
2d284768b49bcf1 drivers/mtd/spi-nor/core.c Jungseung Lee 2020-03-18 1554
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org