From 4ae50c4d7ae7e207ff6958ff98f601fd43738298 Mon Sep 17 00:00:00 2001 From: James Chesterman Date: Wed, 9 Apr 2025 10:49:49 +0100 Subject: [PATCH] mod/cmn_cyprus: Fix bad bit shift operation Attempting to perform a left shift of more than 31 bits causes undefined behaviour. Add a cast to make the bit shift input 64 bits. Signed-off-by: James Chesterman --- module/cmn_cyprus/src/cmn_cyprus_hns_reg.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module/cmn_cyprus/src/cmn_cyprus_hns_reg.c b/module/cmn_cyprus/src/cmn_cyprus_hns_reg.c index b76a3d7ab..a7d88b574 100644 --- a/module/cmn_cyprus/src/cmn_cyprus_hns_reg.c +++ b/module/cmn_cyprus/src/cmn_cyprus_hns_reg.c @@ -1,6 +1,6 @@ /* * Arm SCP/MCP Software - * Copyright (c) 2023-2024, Arm Limited and Contributors. All rights reserved. + * Copyright (c) 2023-2025, Arm Limited and Contributors. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause * @@ -576,7 +576,7 @@ void hns_set_lcn_htg_cpag_id( LCN_HTG_CPAG_PER_HNF_POS); hns->LCN_HASHED_TARGET_GRP_CPAG_PERHNF_REG[register_idx] |= - (cpag_id << bit_pos); + ((uint64_t)cpag_id << bit_pos); } } -- GitLab