diff mbox series

[-next] soc: qcom: smem: Fix incompatible types in comparison

Message ID 20230801094807.4146779-1-chenjiahao16@huawei.com
State Accepted
Commit 5f908786cf44fcb397cfe0f322ef2f41b0909e2a
Headers show
Series [-next] soc: qcom: smem: Fix incompatible types in comparison | expand

Commit Message

Chen Jiahao Aug. 1, 2023, 9:48 a.m. UTC
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")
Signed-off-by: Chen Jiahao <chenjiahao16@huawei.com>
---
 drivers/soc/qcom/smem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Bjorn Andersson Aug. 3, 2023, 4:38 p.m. UTC | #1
On Tue, 01 Aug 2023 17:48:07 +0800, Chen Jiahao wrote:
> 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,
diff mbox series

Patch

diff --git a/drivers/soc/qcom/smem.c b/drivers/soc/qcom/smem.c
index aa4a199efefb..d4a89d2bb43b 100644
--- a/drivers/soc/qcom/smem.c
+++ b/drivers/soc/qcom/smem.c
@@ -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);
 }
 
 /**