[PATCH] platform/x86/amd/pmc: Fix typecast warning from Sparse

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxx>
Acked-by: Basavaraj Natikar <Basavaraj.Natikar@xxxxxxx>
Signed-off-by: Shyam Sundar S K <Shyam-sundar.S-k@xxxxxxx>
---
 drivers/platform/x86/amd/pmc/mp2_stb.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

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;
 
-- 
2.34.1





[Index of Archives]     [Linux Kernel Development]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux