Linux SPI subsystem development
 help / color / mirror / Atom feed
* [PATCH] spi: cadence-quadspi: Silence shiftTooManyBitsSigned warning
@ 2021-03-04 10:47 Jay Fang
  2021-03-04 13:08 ` Dan Carpenter
  2021-03-08 16:08 ` Mark Brown
  0 siblings, 2 replies; 5+ messages in thread
From: Jay Fang @ 2021-03-04 10:47 UTC (permalink / raw)
  To: linux-spi; +Cc: broonie, dan.carpenter, huangdaode

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

Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jay Fang <f.fangjian@huawei.com>
---
 drivers/spi/spi-cadence-quadspi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/spi/spi-cadence-quadspi.c b/drivers/spi/spi-cadence-quadspi.c
index 442cc7c..9a2798a5 100644
--- a/drivers/spi/spi-cadence-quadspi.c
+++ b/drivers/spi/spi-cadence-quadspi.c
@@ -264,7 +264,7 @@ static bool cqspi_is_idle(struct cqspi_st *cqspi)
 {
 	u32 reg = readl(cqspi->iobase + CQSPI_REG_CONFIG);
 
-	return reg & (1 << CQSPI_REG_CONFIG_IDLE_LSB);
+	return reg & (1UL << CQSPI_REG_CONFIG_IDLE_LSB);
 }
 
 static u32 cqspi_get_rd_sram_level(struct cqspi_st *cqspi)
-- 
2.7.4


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

end of thread, other threads:[~2021-03-08 16:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-03-04 10:47 [PATCH] spi: cadence-quadspi: Silence shiftTooManyBitsSigned warning Jay Fang
2021-03-04 13:08 ` Dan Carpenter
2021-03-04 19:34   ` Pratyush Yadav
2021-03-05  9:42     ` Dan Carpenter
2021-03-08 16:08 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox