drivers/mtd/spi-nor/controllers/cadence-quadspi.c:258:18: warning: Shifting signed 32-bit value by 31 bits is implementation-defined behaviour [shiftTooManyBitsSigned]

From: kbuild test robot
Date: Thu Apr 23 2020 - 01:54:44 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: c578ddb39e565139897124e74e5a43e56538cb33
commit: 2098c564701c0dde76063dd9c5c00a7a1f173541 mtd: spi-nor: Compile files in controllers/ directory
date: 13 days ago

If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp@xxxxxxxxx>


cppcheck warnings: (new ones prefixed by >>)

>> drivers/mtd/spi-nor/controllers/cadence-quadspi.c:258:18: warning: Shifting signed 32-bit value by 31 bits is implementation-defined behaviour [shiftTooManyBitsSigned]
return reg & (1 << CQSPI_REG_CONFIG_IDLE_LSB);
^

vim +258 drivers/mtd/spi-nor/controllers/cadence-quadspi.c

14062341053690 drivers/mtd/spi-nor/cadence-quadspi.c Graham Moore 2016-06-04 253
14062341053690 drivers/mtd/spi-nor/cadence-quadspi.c Graham Moore 2016-06-04 254 static bool cqspi_is_idle(struct cqspi_st *cqspi)
14062341053690 drivers/mtd/spi-nor/cadence-quadspi.c Graham Moore 2016-06-04 255 {
14062341053690 drivers/mtd/spi-nor/cadence-quadspi.c Graham Moore 2016-06-04 256 u32 reg = readl(cqspi->iobase + CQSPI_REG_CONFIG);
14062341053690 drivers/mtd/spi-nor/cadence-quadspi.c Graham Moore 2016-06-04 257
14062341053690 drivers/mtd/spi-nor/cadence-quadspi.c Graham Moore 2016-06-04 @258 return reg & (1 << CQSPI_REG_CONFIG_IDLE_LSB);
14062341053690 drivers/mtd/spi-nor/cadence-quadspi.c Graham Moore 2016-06-04 259 }
14062341053690 drivers/mtd/spi-nor/cadence-quadspi.c Graham Moore 2016-06-04 260

:::::: The code at line 258 was first introduced by commit
:::::: 140623410536905fa6ab737b625decfde6c64a72 mtd: spi-nor: Add driver for Cadence Quad SPI Flash Controller

:::::: TO: Graham Moore <grmoore@xxxxxxxxxxxxxxxxxxxxx>
:::::: CC: Brian Norris <computersforpeace@xxxxxxxxx>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx