CC: [email protected]
BCC: [email protected]
CC: [email protected]
TO: Sai Krishna Potthuri <[email protected]>
CC: Michal Simek <[email protected]>

tree:   https://github.com/Xilinx/linux-xlnx xlnx_rebase_v5.15_LTS
head:   1870e0fa79a9d58c6748c34550f3ccea0b515933
commit: e5219f94d0c1bb784c28acf47d5aec8860f079d6 [977/1029] mtd: spi-nor: Avoid 
updating the flash_info struct in dual and stacked modes
:::::: branch date: 2 days ago
:::::: commit date: 2 weeks ago
config: nios2-randconfig-m031-20220324 
(https://download.01.org/0day-ci/archive/20220326/[email protected]/config)
compiler: nios2-linux-gcc (GCC) 11.2.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:55 spi_nor_get_min_prot_length_sr() warn: should 
'sector_size << (bp_slots_needed - bp_slots)' be a 64 bit type?

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

c4c795105f2924c Tudor Ambarus        2021-03-22  35  
c4c795105f2924c Tudor Ambarus        2021-03-22  36  static u64 
spi_nor_get_min_prot_length_sr(struct spi_nor *nor)
c4c795105f2924c Tudor Ambarus        2021-03-22  37  {
c4c795105f2924c Tudor Ambarus        2021-03-22  38     unsigned int bp_slots, 
bp_slots_needed;
c4c795105f2924c Tudor Ambarus        2021-03-22  39     u8 mask = 
spi_nor_get_sr_bp_mask(nor);
e5219f94d0c1bb7 Sai Krishna Potthuri 2022-03-08  40     u32 n_sectors = 
nor->info->n_sectors;
e5219f94d0c1bb7 Sai Krishna Potthuri 2022-03-08  41     u32 sector_size = 
nor->info->sector_size;
e5219f94d0c1bb7 Sai Krishna Potthuri 2022-03-08  42  
e5219f94d0c1bb7 Sai Krishna Potthuri 2022-03-08  43     if (nor->isstacked)
e5219f94d0c1bb7 Sai Krishna Potthuri 2022-03-08  44             n_sectors <<= 1;
e5219f94d0c1bb7 Sai Krishna Potthuri 2022-03-08  45  
e5219f94d0c1bb7 Sai Krishna Potthuri 2022-03-08  46     if (nor->isparallel)
e5219f94d0c1bb7 Sai Krishna Potthuri 2022-03-08  47             sector_size <<= 
1;
c4c795105f2924c Tudor Ambarus        2021-03-22  48  
c4c795105f2924c Tudor Ambarus        2021-03-22  49     /* Reserved one for 
"protect none" and one for "protect all". */
c4c795105f2924c Tudor Ambarus        2021-03-22  50     bp_slots = (1 << 
hweight8(mask)) - 2;
e5219f94d0c1bb7 Sai Krishna Potthuri 2022-03-08  51     bp_slots_needed = 
ilog2(n_sectors);
c4c795105f2924c Tudor Ambarus        2021-03-22  52  
c4c795105f2924c Tudor Ambarus        2021-03-22  53     if (bp_slots_needed > 
bp_slots)
e5219f94d0c1bb7 Sai Krishna Potthuri 2022-03-08  54             return 
sector_size <<
c4c795105f2924c Tudor Ambarus        2021-03-22 @55                     
(bp_slots_needed - bp_slots);
c4c795105f2924c Tudor Ambarus        2021-03-22  56     else
e5219f94d0c1bb7 Sai Krishna Potthuri 2022-03-08  57             return 
sector_size;
c4c795105f2924c Tudor Ambarus        2021-03-22  58  }
c4c795105f2924c Tudor Ambarus        2021-03-22  59  

:::::: The code at line 55 was first introduced by commit
:::::: c4c795105f2924c80752c30ffd3c7029a8e0ef28 mtd: spi-nor: Move Software 
Write Protection logic out of the core

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

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp
_______________________________________________
kbuild mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to