All of lore.kernel.org
 help / color / mirror / Atom feed
* [kbuild] drivers/spi/spi-cadence-quadspi.c:250:18: warning: Shifting signed 32-bit value by 31 bits is undefined behaviour
@ 2021-03-02 12:11 ` Dan Carpenter
  0 siblings, 0 replies; 3+ messages in thread
From: Dan Carpenter @ 2021-03-02 12:11 UTC (permalink / raw)
  To: kbuild, Ramuthevar Vadivel Murugan
  Cc: lkp, kbuild-all, linux-kernel, Mark Brown, Vignesh Raghavendra,
	Tudor Ambarus

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git  master
head:   7a7fd0de4a9804299793e564a555a49c1fc924cb
commit: 31fb632b5d43ca16713095b3a4fe17e3d7331e28 spi: Move cadence-quadspi driver to drivers/spi/
compiler: nds32le-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>

cppcheck possible warnings: (new ones prefixed by >>, may not real problems)

>> drivers/spi/spi-cadence-quadspi.c:250:18: warning: Shifting signed 32-bit value by 31 bits is undefined behaviour [shiftTooManyBitsSigned]
    return reg & (1 << CQSPI_REG_CONFIG_IDLE_LSB);

vim +250 drivers/spi/spi-cadence-quadspi.c

14062341053690 drivers/mtd/spi-nor/cadence-quadspi.c Graham Moore 2016-06-04  246  static bool cqspi_is_idle(struct cqspi_st *cqspi)
14062341053690 drivers/mtd/spi-nor/cadence-quadspi.c Graham Moore 2016-06-04  247  {
14062341053690 drivers/mtd/spi-nor/cadence-quadspi.c Graham Moore 2016-06-04  248  	u32 reg = readl(cqspi->iobase + CQSPI_REG_CONFIG);
14062341053690 drivers/mtd/spi-nor/cadence-quadspi.c Graham Moore 2016-06-04  249  
14062341053690 drivers/mtd/spi-nor/cadence-quadspi.c Graham Moore 2016-06-04 @250  	return reg & (1 << CQSPI_REG_CONFIG_IDLE_LSB);
                                                                                                           ^^^^^^^^^^^^^^^^^^^^^^^^^
CQSPI_REG_CONFIG_IDLE_LSB is 31 and reg is a u32 so this is very
puzzling.

14062341053690 drivers/mtd/spi-nor/cadence-quadspi.c Graham Moore 2016-06-04  251  }

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org 
_______________________________________________
kbuild mailing list -- kbuild@lists.01.org
To unsubscribe send an email to kbuild-leave@lists.01.org

^ permalink raw reply	[flat|nested] 3+ messages in thread

* drivers/spi/spi-cadence-quadspi.c:250:18: warning: Shifting signed 32-bit value by 31 bits is undefined behaviour
@ 2021-03-02 12:11 ` Dan Carpenter
  0 siblings, 0 replies; 3+ messages in thread
From: Dan Carpenter @ 2021-03-02 12:11 UTC (permalink / raw)
  To: kbuild

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git  master
head:   7a7fd0de4a9804299793e564a555a49c1fc924cb
commit: 31fb632b5d43ca16713095b3a4fe17e3d7331e28 spi: Move cadence-quadspi driver to drivers/spi/
compiler: nds32le-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>

cppcheck possible warnings: (new ones prefixed by >>, may not real problems)

>> drivers/spi/spi-cadence-quadspi.c:250:18: warning: Shifting signed 32-bit value by 31 bits is undefined behaviour [shiftTooManyBitsSigned]
    return reg & (1 << CQSPI_REG_CONFIG_IDLE_LSB);

vim +250 drivers/spi/spi-cadence-quadspi.c

14062341053690 drivers/mtd/spi-nor/cadence-quadspi.c Graham Moore 2016-06-04  246  static bool cqspi_is_idle(struct cqspi_st *cqspi)
14062341053690 drivers/mtd/spi-nor/cadence-quadspi.c Graham Moore 2016-06-04  247  {
14062341053690 drivers/mtd/spi-nor/cadence-quadspi.c Graham Moore 2016-06-04  248  	u32 reg = readl(cqspi->iobase + CQSPI_REG_CONFIG);
14062341053690 drivers/mtd/spi-nor/cadence-quadspi.c Graham Moore 2016-06-04  249  
14062341053690 drivers/mtd/spi-nor/cadence-quadspi.c Graham Moore 2016-06-04 @250  	return reg & (1 << CQSPI_REG_CONFIG_IDLE_LSB);
                                                                                                           ^^^^^^^^^^^^^^^^^^^^^^^^^
CQSPI_REG_CONFIG_IDLE_LSB is 31 and reg is a u32 so this is very
puzzling.

14062341053690 drivers/mtd/spi-nor/cadence-quadspi.c Graham Moore 2016-06-04  251  }

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org 
_______________________________________________
kbuild mailing list -- kbuild(a)lists.01.org
To unsubscribe send an email to kbuild-leave@lists.01.org

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [kbuild] drivers/spi/spi-cadence-quadspi.c:250:18: warning: Shifting signed 32-bit value by 31 bits is undefined behaviour
@ 2021-03-02 12:11 ` Dan Carpenter
  0 siblings, 0 replies; 3+ messages in thread
From: Dan Carpenter @ 2021-03-02 12:11 UTC (permalink / raw)
  To: kbuild-all

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git  master
head:   7a7fd0de4a9804299793e564a555a49c1fc924cb
commit: 31fb632b5d43ca16713095b3a4fe17e3d7331e28 spi: Move cadence-quadspi driver to drivers/spi/
compiler: nds32le-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>

cppcheck possible warnings: (new ones prefixed by >>, may not real problems)

>> drivers/spi/spi-cadence-quadspi.c:250:18: warning: Shifting signed 32-bit value by 31 bits is undefined behaviour [shiftTooManyBitsSigned]
    return reg & (1 << CQSPI_REG_CONFIG_IDLE_LSB);

vim +250 drivers/spi/spi-cadence-quadspi.c

14062341053690 drivers/mtd/spi-nor/cadence-quadspi.c Graham Moore 2016-06-04  246  static bool cqspi_is_idle(struct cqspi_st *cqspi)
14062341053690 drivers/mtd/spi-nor/cadence-quadspi.c Graham Moore 2016-06-04  247  {
14062341053690 drivers/mtd/spi-nor/cadence-quadspi.c Graham Moore 2016-06-04  248  	u32 reg = readl(cqspi->iobase + CQSPI_REG_CONFIG);
14062341053690 drivers/mtd/spi-nor/cadence-quadspi.c Graham Moore 2016-06-04  249  
14062341053690 drivers/mtd/spi-nor/cadence-quadspi.c Graham Moore 2016-06-04 @250  	return reg & (1 << CQSPI_REG_CONFIG_IDLE_LSB);
                                                                                                           ^^^^^^^^^^^^^^^^^^^^^^^^^
CQSPI_REG_CONFIG_IDLE_LSB is 31 and reg is a u32 so this is very
puzzling.

14062341053690 drivers/mtd/spi-nor/cadence-quadspi.c Graham Moore 2016-06-04  251  }

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org 
_______________________________________________
kbuild mailing list -- kbuild(a)lists.01.org
To unsubscribe send an email to kbuild-leave@lists.01.org

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-03-02 13:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-02 12:11 [kbuild] drivers/spi/spi-cadence-quadspi.c:250:18: warning: Shifting signed 32-bit value by 31 bits is undefined behaviour Dan Carpenter
2021-03-02 12:11 ` Dan Carpenter
2021-03-02 12:11 ` Dan Carpenter

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.