Linux-HyperV List
 help / color / mirror / Atom feed
* [PATCH] Fixing warning cast removes address space '__iomem' of expression
@ 2023-10-24 11:28 Abhinav Singh
  2023-10-28 20:10 ` Michael Kelley (LINUX)
  0 siblings, 1 reply; 5+ messages in thread
From: Abhinav Singh @ 2023-10-24 11:28 UTC (permalink / raw)
  To: kys, haiyangz, wei.liu, decui, tglx, mingo, bp, dave.hansen, hpa
  Cc: linux-hyperv, linux-kernel, linux-kernel-mentees, Abhinav Singh

This patch fixes sparse complaining about the removal of __iomem address
space when casting the return value of this function ioremap_cache(...)
from `void __ioremap*` to `void*`.

I think there are two way of fixing it, first one is changing the
datatype of variable `ghcb_va` from `void*` to `void __iomem*` . 
Second way of fixing it is using the memremap(...) which is 
done in this patch.

Signed-off-by: Abhinav Singh <singhabhinav9051571833@gmail.com>
---
 arch/x86/hyperv/hv_init.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/hyperv/hv_init.c b/arch/x86/hyperv/hv_init.c
index 21556ad87f4b..c14161add274 100644
--- a/arch/x86/hyperv/hv_init.c
+++ b/arch/x86/hyperv/hv_init.c
@@ -70,7 +70,7 @@ static int hyperv_init_ghcb(void)
 
 	/* Mask out vTOM bit. ioremap_cache() maps decrypted */
 	ghcb_gpa &= ~ms_hyperv.shared_gpa_boundary;
-	ghcb_va = (void *)ioremap_cache(ghcb_gpa, HV_HYP_PAGE_SIZE);
+	ghcb_va = memremap(ghcb_gpa, HV_HYP_PAGE_SIZE, MEMREMAP_WB);
 	if (!ghcb_va)
 		return -ENOMEM;
 
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-10-30 17:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-24 11:28 [PATCH] Fixing warning cast removes address space '__iomem' of expression Abhinav Singh
2023-10-28 20:10 ` Michael Kelley (LINUX)
2023-10-28 21:26   ` Abhinav Singh
2023-10-30 16:38     ` Michael Kelley (LINUX)
2023-10-30 17:36       ` Abhinav Singh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox