From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: 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
Date: Sun, 02 Aug 2020 04:44:02 +0800 [thread overview]
Message-ID: <202008020454.vdJuK1o3%lkp@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 3445 bytes --]
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Jungseung Lee <js07.lee@samsung.com>
CC: 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: d52daa8620c65960e1ef882adc1f92061326bd7a
commit: 2d284768b49bcf1c643c08a201ff2161041178ef mtd: spi-nor: Add generic formula for SR block protection handling
date: 4 months ago
:::::: branch date: 4 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@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@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/?id=2d284768b49bcf1c643c08a201ff2161041178ef
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
b199489d37b21c drivers/mtd/spi-nor/spi-nor.c Huang Shijie 2014-02-24 1538
2d284768b49bcf 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)
2d284768b49bcf drivers/mtd/spi-nor/core.c Jungseung Lee 2020-03-18 1540 {
2d284768b49bcf drivers/mtd/spi-nor/core.c Jungseung Lee 2020-03-18 1541 unsigned int bp_slots, bp_slots_needed;
2d284768b49bcf drivers/mtd/spi-nor/core.c Jungseung Lee 2020-03-18 1542 u8 mask = SR_BP2 | SR_BP1 | SR_BP0;
2d284768b49bcf drivers/mtd/spi-nor/core.c Jungseung Lee 2020-03-18 1543
2d284768b49bcf drivers/mtd/spi-nor/core.c Jungseung Lee 2020-03-18 1544 /* Reserved one for "protect none" and one for "protect all". */
2d284768b49bcf drivers/mtd/spi-nor/core.c Jungseung Lee 2020-03-18 1545 bp_slots = (mask >> SR_BP_SHIFT) + 1 - 2;
2d284768b49bcf drivers/mtd/spi-nor/core.c Jungseung Lee 2020-03-18 1546 bp_slots_needed = ilog2(nor->info->n_sectors);
2d284768b49bcf drivers/mtd/spi-nor/core.c Jungseung Lee 2020-03-18 1547
2d284768b49bcf drivers/mtd/spi-nor/core.c Jungseung Lee 2020-03-18 1548 if (bp_slots_needed > bp_slots)
2d284768b49bcf drivers/mtd/spi-nor/core.c Jungseung Lee 2020-03-18 1549 return nor->info->sector_size <<
2d284768b49bcf drivers/mtd/spi-nor/core.c Jungseung Lee 2020-03-18 @1550 (bp_slots_needed - bp_slots);
2d284768b49bcf drivers/mtd/spi-nor/core.c Jungseung Lee 2020-03-18 1551 else
2d284768b49bcf drivers/mtd/spi-nor/core.c Jungseung Lee 2020-03-18 1552 return nor->info->sector_size;
2d284768b49bcf drivers/mtd/spi-nor/core.c Jungseung Lee 2020-03-18 1553 }
2d284768b49bcf 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(a)lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 28888 bytes --]
next reply other threads:[~2020-08-01 20:44 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-01 20:44 kernel test robot [this message]
-- strict thread matches above, loose matches on Subject: below --
2020-07-31 22:00 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 kernel test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202008020454.vdJuK1o3%lkp@intel.com \
--to=lkp@intel.com \
--cc=kbuild@lists.01.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.