CC: [email protected]
CC: [email protected]
TO: Tudor Ambarus <[email protected]>
CC: Michael Walle <[email protected]>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
master
head:   ad347abe4a9876b1f65f408ab467137e88f77eb4
commit: c4c795105f2924c80752c30ffd3c7029a8e0ef28 mtd: spi-nor: Move Software 
Write Protection logic out of the core
date:   2 months ago
:::::: branch date: 2 hours ago
:::::: commit date: 2 months ago
config: x86_64-randconfig-m001-20210611 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <[email protected]>
Reported-by: Dan Carpenter <[email protected]>

smatch warnings:
drivers/mtd/spi-nor/swp.c:45 spi_nor_get_min_prot_length_sr() warn: should 
'nor->info->sector_size << (bp_slots_needed - bp_slots)' be a 64 bit type?

vim +45 drivers/mtd/spi-nor/swp.c

c4c795105f2924 Tudor Ambarus 2021-03-22  33  
c4c795105f2924 Tudor Ambarus 2021-03-22  34  static u64 
spi_nor_get_min_prot_length_sr(struct spi_nor *nor)
c4c795105f2924 Tudor Ambarus 2021-03-22  35  {
c4c795105f2924 Tudor Ambarus 2021-03-22  36     unsigned int bp_slots, 
bp_slots_needed;
c4c795105f2924 Tudor Ambarus 2021-03-22  37     u8 mask = 
spi_nor_get_sr_bp_mask(nor);
c4c795105f2924 Tudor Ambarus 2021-03-22  38  
c4c795105f2924 Tudor Ambarus 2021-03-22  39     /* Reserved one for "protect 
none" and one for "protect all". */
c4c795105f2924 Tudor Ambarus 2021-03-22  40     bp_slots = (1 << 
hweight8(mask)) - 2;
c4c795105f2924 Tudor Ambarus 2021-03-22  41     bp_slots_needed = 
ilog2(nor->info->n_sectors);
c4c795105f2924 Tudor Ambarus 2021-03-22  42  
c4c795105f2924 Tudor Ambarus 2021-03-22  43     if (bp_slots_needed > bp_slots)
c4c795105f2924 Tudor Ambarus 2021-03-22  44             return 
nor->info->sector_size <<
c4c795105f2924 Tudor Ambarus 2021-03-22 @45                     
(bp_slots_needed - bp_slots);
c4c795105f2924 Tudor Ambarus 2021-03-22  46     else
c4c795105f2924 Tudor Ambarus 2021-03-22  47             return 
nor->info->sector_size;
c4c795105f2924 Tudor Ambarus 2021-03-22  48  }
c4c795105f2924 Tudor Ambarus 2021-03-22  49  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]

Attachment: .config.gz
Description: application/gzip

_______________________________________________
kbuild mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to