summaryrefslogtreecommitdiff
path: root/drivers/accel
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@linaro.org>2025-10-29 08:30:11 +0300
committerSasha Levin <sashal@kernel.org>2026-03-12 07:09:08 -0400
commit700c13ac1afd561fb3e03c84fff7a4361a93fa65 (patch)
tree057c075d9b4d4df9890578155b9492ccfc8fbeaa /drivers/accel
parent227ff4af00abc40b95123cc27ee8079069dcd8d7 (diff)
accel: ethosu: Fix shift overflow in cmd_to_addr()
[ Upstream commit 7be41fb00e2c2a823f271a8318b453ca11812f1e ] The "((cmd[0] & 0xff0000) << 16)" shift is zero. This was intended to be (((u64)cmd[0] & 0xff0000) << 16). Move the cast to the correct location. Fixes: 5a5e9c0228e6 ("accel: Add Arm Ethos-U NPU driver") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Link: https://patch.msgid.link/aQGmY64tWcwOGFP4@stanley.mountain Signed-off-by: Rob Herring (Arm) <robh@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/accel')
-rw-r--r--drivers/accel/ethosu/ethosu_gem.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/accel/ethosu/ethosu_gem.c b/drivers/accel/ethosu/ethosu_gem.c
index 473b5f5d7514..7b073116314b 100644
--- a/drivers/accel/ethosu/ethosu_gem.c
+++ b/drivers/accel/ethosu/ethosu_gem.c
@@ -154,7 +154,7 @@ static void cmd_state_init(struct cmd_state *st)
static u64 cmd_to_addr(u32 *cmd)
{
- return ((u64)((cmd[0] & 0xff0000) << 16)) | cmd[1];
+ return (((u64)cmd[0] & 0xff0000) << 16) | cmd[1];
}
static u64 dma_length(struct ethosu_validated_cmdstream_info *info,