Skip to contentSkip to conversation

drm/i915: use IOMEM_ERR_PTR() directly

PATCH Applied Kefeng Wang 3 participants 3 messages May 2, 2022 – May 4, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/i915: use IOMEM_ERR_PTR() directly

Use IOMEM_ERR_PTR() instead of self defined IO_ERR_PTR().

---
 drivers/gpu/drm/i915/i915_vma.c | 4 ++--
 drivers/gpu/drm/i915/i915_vma.h | 1 -
 2 files changed, 2 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/i915_vma.c +2 -2
index 94fcdb7bd21d..639605c89b7b 100644
@@ -541,7 +541,7 @@ void __iomem *i915_vma_pin_iomap(struct i915_vma *vma)
 	int err;
 
 	if (WARN_ON_ONCE(vma->obj->flags & I915_BO_ALLOC_GPU_ONLY))
-		return IO_ERR_PTR(-EINVAL);
+		return IOMEM_ERR_PTR(-EINVAL);
 
 	if (!i915_gem_object_is_lmem(vma->obj)) {
 		if (GEM_WARN_ON(!i915_vma_is_map_and_fenceable(vma))) {
@@ -594,7 +594,7 @@ void __iomem *i915_vma_pin_iomap(struct i915_vma *vma)
 err_unpin:
 	__i915_vma_unpin(vma);
 err:
-	return IO_ERR_PTR(err);
+	return IOMEM_ERR_PTR(err);
 }
 
 void i915_vma_flush_writes(struct i915_vma *vma)
drivers/gpu/drm/i915/i915_vma.h +0 -1
index 67ae7341c7e0..8e74972fdca3 100644
@@ -331,7 +331,6 @@ static inline bool i915_node_color_differs(const struct drm_mm_node *node,
  * Returns a valid iomapped pointer or ERR_PTR.
  */
 void __iomem *i915_vma_pin_iomap(struct i915_vma *vma);
-#define IO_ERR_PTR(x) ((void __iomem *)ERR_PTR(x))
 
 /**
  * i915_vma_unpin_iomap - unpins the mapping returned from i915_vma_iomap
Signature · 1 line
2.35.3
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 3 lines · Kefeng Wang

Use IOMEM_ERR_PTR() instead of self defined IO_ERR_PTR().

Quoted 39 lines
---
 drivers/gpu/drm/i915/i915_vma.c | 4 ++--
 drivers/gpu/drm/i915/i915_vma.h | 1 -
 2 files changed, 2 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/i915_vma.c +2 -2
index 94fcdb7bd21d..639605c89b7b 100644
@@ -541,7 +541,7 @@ void __iomem *i915_vma_pin_iomap(struct i915_vma *vma)
 	int err;
 
 	if (WARN_ON_ONCE(vma->obj->flags & I915_BO_ALLOC_GPU_ONLY))
-		return IO_ERR_PTR(-EINVAL);
+		return IOMEM_ERR_PTR(-EINVAL);
 
 	if (!i915_gem_object_is_lmem(vma->obj)) {
 		if (GEM_WARN_ON(!i915_vma_is_map_and_fenceable(vma))) {
@@ -594,7 +594,7 @@ void __iomem *i915_vma_pin_iomap(struct i915_vma *vma)
 err_unpin:
 	__i915_vma_unpin(vma);
 err:
-	return IO_ERR_PTR(err);
+	return IOMEM_ERR_PTR(err);
 }
 
 void i915_vma_flush_writes(struct i915_vma *vma)
drivers/gpu/drm/i915/i915_vma.h +0 -1
index 67ae7341c7e0..8e74972fdca3 100644
@@ -331,7 +331,6 @@ static inline bool i915_node_color_differs(const struct drm_mm_node *node,
  * Returns a valid iomapped pointer or ERR_PTR.
  */
 void __iomem *i915_vma_pin_iomap(struct i915_vma *vma);
-#define IO_ERR_PTR(x) ((void __iomem *)ERR_PTR(x))
 
 /**
  * i915_vma_unpin_iomap - unpins the mapping returned from i915_vma_iomap
Signature · 1 line
Jani Nikula, Intel Open Source Graphics Center
#2 lore raw
Quoted 6 lines · Jani Nikula
Quoted 3 lines · Kefeng Wang

Use IOMEM_ERR_PTR() instead of self defined IO_ERR_PTR().

Pushed to drm-intel-gt-next, thanks for the patch and review!

Regards,

Tvrtko

Quoted 41 lines
Quoted 40 lines
---
  drivers/gpu/drm/i915/i915_vma.c | 4 ++--
  drivers/gpu/drm/i915/i915_vma.h | 1 -
  2 files changed, 2 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/i915_vma.c +2 -2
index 94fcdb7bd21d..639605c89b7b 100644
@@ -541,7 +541,7 @@ void __iomem *i915_vma_pin_iomap(struct i915_vma *vma)
  	int err;
 
  	if (WARN_ON_ONCE(vma->obj->flags & I915_BO_ALLOC_GPU_ONLY))
-		return IO_ERR_PTR(-EINVAL);
+		return IOMEM_ERR_PTR(-EINVAL);
 
  	if (!i915_gem_object_is_lmem(vma->obj)) {
  		if (GEM_WARN_ON(!i915_vma_is_map_and_fenceable(vma))) {
@@ -594,7 +594,7 @@ void __iomem *i915_vma_pin_iomap(struct i915_vma *vma)
  err_unpin:
  	__i915_vma_unpin(vma);
  err:
-	return IO_ERR_PTR(err);
+	return IOMEM_ERR_PTR(err);
  }
 
  void i915_vma_flush_writes(struct i915_vma *vma)
drivers/gpu/drm/i915/i915_vma.h +0 -1
index 67ae7341c7e0..8e74972fdca3 100644
@@ -331,7 +331,6 @@ static inline bool i915_node_color_differs(const struct drm_mm_node *node,
   * Returns a valid iomapped pointer or ERR_PTR.
   */
  void __iomem *i915_vma_pin_iomap(struct i915_vma *vma);
-#define IO_ERR_PTR(x) ((void __iomem *)ERR_PTR(x))
 
  /**
   * i915_vma_unpin_iomap - unpins the mapping returned from i915_vma_iomap