[Intel-gfx] [PATCH 1/2] drm/i915: Silence __iomem sparse warn

Ville Syrjala ville.syrjala at linux.intel.com
Mon Jul 12 16:18:14 UTC 2021


From: Ville Syrjälä <ville.syrjala at linux.intel.com>

We don't care about __iomem mismatch when dealing with error
pointers. Silence it with ERR_CAST().

drivers/gpu/drm/i915/display/intel_display.c:1896:21:    expected struct i915_vma *[assigned] vma
drivers/gpu/drm/i915/display/intel_display.c:1896:21:    got void [noderef] __iomem *[assigned] iomem
drivers/gpu/drm/i915/display/intel_display.c:1896:21: warning: incorrect type in assignment (different address spaces)

Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
---
 drivers/gpu/drm/i915/display/intel_display.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
index 026c28c612f0..496b72f10b4e 100644
--- a/drivers/gpu/drm/i915/display/intel_display.c
+++ b/drivers/gpu/drm/i915/display/intel_display.c
@@ -1893,7 +1893,7 @@ static struct i915_vma *intel_dpt_pin(struct i915_address_space *vm)
 	iomem = i915_vma_pin_iomap(vma);
 	i915_vma_unpin(vma);
 	if (IS_ERR(iomem)) {
-		vma = iomem;
+		vma = ERR_CAST(iomem);
 		goto err;
 	}
 
-- 
2.31.1



More information about the Intel-gfx mailing list