Skip to contentSkip to conversation

soc: qcom: smem: Fix incompatible types in comparison

PATCH Applied Chen Jiahao 2 participants 2 messages Aug 1, 2023 – Aug 3, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 soc: qcom: smem: Fix incompatible types in comparison

This patch fixes the following sparse error:

drivers/soc/qcom/smem.c:738:30: error: incompatible types in comparison expression (different add ress spaces):
drivers/soc/qcom/smem.c:738:30: void *
drivers/soc/qcom/smem.c:738:30: void [noderef] __iomem *

In addr_in_range(), "base" is of type void __iomem *, converting void *addr to the same type to fix above sparse error.

Fixes 20bb6c9de1b7 ("soc: qcom: smem: map only partitions used by local HOST")
---
 drivers/soc/qcom/smem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/soc/qcom/smem.c +1 -1
index aa4a199efefb..d4a89d2bb43b 100644
@@ -735,7 +735,7 @@ EXPORT_SYMBOL_GPL(qcom_smem_get_free_space);
 
 static bool addr_in_range(void __iomem *base, size_t size, void *addr)
 {
-	return base && (addr >= base && addr < base + size);
+	return base && ((void __iomem *)addr >= base && (void __iomem *)addr < base + size);
 }
 
 /**
Signature · 1 line
2.34.1
maintainer Applied
#1 lore raw
Quoted 10 lines · Chen Jiahao

This patch fixes the following sparse error:

drivers/soc/qcom/smem.c:738:30: error: incompatible types in comparison expression (different add ress spaces):
drivers/soc/qcom/smem.c:738:30: void *
drivers/soc/qcom/smem.c:738:30: void [noderef] __iomem *

In addr_in_range(), "base" is of type void __iomem *, converting void *addr to the same type to fix above sparse error.

[...]

Applied, thanks!

[1/1] soc: qcom: smem: Fix incompatible types in comparison

      commit: 5f908786cf44fcb397cfe0f322ef2f41b0909e2a

Best regards,

Signature · 1 line
Bjorn Andersson <[email protected]>