lkml.org 
[lkml]   [2019]   [Sep]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v2 3/3] soc: amazon: al-pos: cast to u64 before left shifting
Date
Fix wrap around for pos errors on addresses above 32 bit.

Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Talel Shenhar <talel@amazon.com>
---
drivers/soc/amazon/al_pos.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/soc/amazon/al_pos.c b/drivers/soc/amazon/al_pos.c
index a865111..e95e1fc 100644
--- a/drivers/soc/amazon/al_pos.c
+++ b/drivers/soc/amazon/al_pos.c
@@ -49,7 +49,7 @@ static irqreturn_t al_pos_irq_handler(int irq, void *info)
writel(0, pos->mmio_base + AL_POS_ERROR_LOG_1);

addr = FIELD_GET(AL_POS_ERROR_LOG_0_ADDR_LOW, log0);
- addr |= (FIELD_GET(AL_POS_ERROR_LOG_1_ADDR_HIGH, log1) << 32);
+ addr |= (((u64)FIELD_GET(AL_POS_ERROR_LOG_1_ADDR_HIGH, log1)) << 32);
request_id = FIELD_GET(AL_POS_ERROR_LOG_1_REQUEST_ID, log1);
bresp = FIELD_GET(AL_POS_ERROR_LOG_1_BRESP, log1);

--
2.7.4
\
 
 \ /
  Last update: 2019-09-10 21:06    [W:0.154 / U:2.328 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site