All of lore.kernel.org
 help / color / mirror / Atom feed
* 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?
@ 2021-06-12  2:33 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2021-06-12  2:33 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 2324 bytes --]

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Tudor Ambarus <tudor.ambarus@microchip.com>
CC: Michael Walle <michael@walle.cc>

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 <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

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/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 36240 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-06-12  2:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-12  2:33 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? kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.