diff mbox series

platform/x86/amd/pmc: Fix typecast warning from Sparse

Message ID 20241205095649.2260654-1-Shyam-sundar.S-k@amd.com (mailing list archive)
State New
Headers show
Series platform/x86/amd/pmc: Fix typecast warning from Sparse | expand

Commit Message

Shyam Sundar S K Dec. 5, 2024, 9:56 a.m. UTC
Sparse reported the following problem with typecasting. Fix this by doing
an appropriate typecast during assignment.

drivers/platform/x86/amd/pmc/mp2_stb.c:105:30: warning: incorrect type in
assignment (different address spaces)
drivers/platform/x86/amd/pmc/mp2_stb.c:105:30:    expected void [noderef]
__iomem *vslbase
drivers/platform/x86/amd/pmc/mp2_stb.c:105:30:    got void *

Fixes: 2dc77993cb5e ("platform/x86/amd/pmc: Add AMD MP2 STB functionality")
Suggested-by: Sanket Goswami <Sanket.Goswami@amd.com>
Acked-by: Basavaraj Natikar <Basavaraj.Natikar@amd.com>
Signed-off-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
---
 drivers/platform/x86/amd/pmc/mp2_stb.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/platform/x86/amd/pmc/mp2_stb.c b/drivers/platform/x86/amd/pmc/mp2_stb.c
index 9775ddc1b27a..2014435dc989 100644
--- a/drivers/platform/x86/amd/pmc/mp2_stb.c
+++ b/drivers/platform/x86/amd/pmc/mp2_stb.c
@@ -102,7 +102,8 @@  static int amd_mp2_stb_region(struct amd_mp2_dev *mp2)
 	unsigned int len = mp2->stb_len;
 
 	if (!mp2->stbdata) {
-		mp2->vslbase = dmam_alloc_coherent(dev, len, &mp2->dma_addr, GFP_KERNEL);
+		mp2->vslbase = (void __iomem *)dmam_alloc_coherent(dev, len, &mp2->dma_addr,
+								   GFP_KERNEL);
 		if (!mp2->vslbase)
 			return -ENOMEM;