summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAnup Patel <anup.patel@oss.qualcomm.com>2026-06-12 11:52:18 +0530
committerAnup Patel <anup@brainfault.org>2026-06-12 11:58:21 +0530
commitc175c97a2774318145dcc16ebb6d39f635002489 (patch)
treed464d6c89283b8d7b5ccde0bf143b77ba7309433 /lib
parent895201cc5a4dfca2df523287bef872197eb95d16 (diff)
downloadopensbi-c175c97a2774318145dcc16ebb6d39f635002489.tar.gz
opensbi-c175c97a2774318145dcc16ebb6d39f635002489.zip
lib: sbi: Fix LLVM compile error observed in sbi_mpxy.c
The following LLVM compile error is observed in sbi_mpxy.c: CC lib/sbi/sbi_mpxy.o lib/sbi/sbi_mpxy.c:535:36: error: result of comparison of constant 18446744073709551615 with expression of type 'u32' (aka 'unsigned int') is always false [-Werror,-Wtautological-constant-out-of-range-compare] 535 | (attrs->msi_info.msi_addr_hi == INVALID_ADDR)) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~ lib/sbi/sbi_mpxy.c:534:36: error: result of comparison of constant 18446744073709551615 with expression of type 'u32' (aka 'unsigned int') is always false [-Werror,-Wtautological-constant-out-of-range-compare] 534 | (attrs->msi_info.msi_addr_lo == INVALID_ADDR) && | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~ 2 errors generated. To address the above issue, add u32 typecast to INVALID_ADDR. Fixes: e92c8fd0836e ("sbi: mpxy: define INVALID_ADDR using unsigned long width") Fixes: 7939bf1329eb ("lib: sbi: Add SBI Message Proxy (MPXY) framework") Signed-off-by: Anup Patel <anup.patel@oss.qualcomm.com> Link: https://lore.kernel.org/r/20260612062218.172726-1-anup.patel@oss.qualcomm.com Signed-off-by: Anup Patel <anup@brainfault.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/sbi/sbi_mpxy.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/sbi/sbi_mpxy.c b/lib/sbi/sbi_mpxy.c
index 3e0e0af6..ff5c6ab6 100644
--- a/lib/sbi/sbi_mpxy.c
+++ b/lib/sbi/sbi_mpxy.c
@@ -531,8 +531,8 @@ static int mpxy_check_write_std_attr(struct sbi_mpxy_channel *channel,
if (attr_val > 1)
ret = SBI_ERR_INVALID_PARAM;
if (attr_val == 1 &&
- (attrs->msi_info.msi_addr_lo == INVALID_ADDR) &&
- (attrs->msi_info.msi_addr_hi == INVALID_ADDR))
+ (attrs->msi_info.msi_addr_lo == (u32)INVALID_ADDR) &&
+ (attrs->msi_info.msi_addr_hi == (u32)INVALID_ADDR))
ret = SBI_ERR_DENIED;
break;
case SBI_MPXY_ATTR_MSI_ADDR_LO: