linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/i915: use IOMEM_ERR_PTR() directly
@ 2022-05-02  3:43 Kefeng Wang
  2022-05-02  8:30 ` Jani Nikula
  0 siblings, 1 reply; 3+ messages in thread
From: Kefeng Wang @ 2022-05-02  3:43 UTC (permalink / raw)
  To: Jani Nikula, Joonas Lahtinen, Rodrigo Vivi, Tvrtko Ursulin,
	David Airlie, Daniel Vetter
  Cc: intel-gfx, dri-devel, linux-kernel, Kefeng Wang

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

Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
 drivers/gpu/drm/i915/i915_vma.c | 4 ++--
 drivers/gpu/drm/i915/i915_vma.h | 1 -
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_vma.c b/drivers/gpu/drm/i915/i915_vma.c
index 94fcdb7bd21d..639605c89b7b 100644
--- a/drivers/gpu/drm/i915/i915_vma.c
+++ b/drivers/gpu/drm/i915/i915_vma.c
@@ -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)
diff --git a/drivers/gpu/drm/i915/i915_vma.h b/drivers/gpu/drm/i915/i915_vma.h
index 67ae7341c7e0..8e74972fdca3 100644
--- a/drivers/gpu/drm/i915/i915_vma.h
+++ b/drivers/gpu/drm/i915/i915_vma.h
@@ -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
-- 
2.35.3


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

* Re: [PATCH] drm/i915: use IOMEM_ERR_PTR() directly
  2022-05-02  3:43 [PATCH] drm/i915: use IOMEM_ERR_PTR() directly Kefeng Wang
@ 2022-05-02  8:30 ` Jani Nikula
  2022-05-04 12:11   ` Tvrtko Ursulin
  0 siblings, 1 reply; 3+ messages in thread
From: Jani Nikula @ 2022-05-02  8:30 UTC (permalink / raw)
  To: Kefeng Wang, Joonas Lahtinen, Rodrigo Vivi, Tvrtko Ursulin,
	David Airlie, Daniel Vetter
  Cc: intel-gfx, dri-devel, linux-kernel, Kefeng Wang

On Mon, 02 May 2022, Kefeng Wang <wangkefeng.wang@huawei.com> wrote:
> Use IOMEM_ERR_PTR() instead of self defined IO_ERR_PTR().
>
> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>

Reviewed-by: Jani Nikula <jani.nikula@intel.com>

> ---
>  drivers/gpu/drm/i915/i915_vma.c | 4 ++--
>  drivers/gpu/drm/i915/i915_vma.h | 1 -
>  2 files changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_vma.c b/drivers/gpu/drm/i915/i915_vma.c
> index 94fcdb7bd21d..639605c89b7b 100644
> --- a/drivers/gpu/drm/i915/i915_vma.c
> +++ b/drivers/gpu/drm/i915/i915_vma.c
> @@ -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)
> diff --git a/drivers/gpu/drm/i915/i915_vma.h b/drivers/gpu/drm/i915/i915_vma.h
> index 67ae7341c7e0..8e74972fdca3 100644
> --- a/drivers/gpu/drm/i915/i915_vma.h
> +++ b/drivers/gpu/drm/i915/i915_vma.h
> @@ -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

-- 
Jani Nikula, Intel Open Source Graphics Center

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

* Re: [PATCH] drm/i915: use IOMEM_ERR_PTR() directly
  2022-05-02  8:30 ` Jani Nikula
@ 2022-05-04 12:11   ` Tvrtko Ursulin
  0 siblings, 0 replies; 3+ messages in thread
From: Tvrtko Ursulin @ 2022-05-04 12:11 UTC (permalink / raw)
  To: Jani Nikula, Kefeng Wang, Joonas Lahtinen, Rodrigo Vivi,
	David Airlie, Daniel Vetter
  Cc: intel-gfx, dri-devel, linux-kernel


On 02/05/2022 09:30, Jani Nikula wrote:
> On Mon, 02 May 2022, Kefeng Wang <wangkefeng.wang@huawei.com> wrote:
>> Use IOMEM_ERR_PTR() instead of self defined IO_ERR_PTR().
>>
>> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
> 
> Reviewed-by: Jani Nikula <jani.nikula@intel.com>

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

Regards,

Tvrtko

> 
>> ---
>>   drivers/gpu/drm/i915/i915_vma.c | 4 ++--
>>   drivers/gpu/drm/i915/i915_vma.h | 1 -
>>   2 files changed, 2 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/i915/i915_vma.c b/drivers/gpu/drm/i915/i915_vma.c
>> index 94fcdb7bd21d..639605c89b7b 100644
>> --- a/drivers/gpu/drm/i915/i915_vma.c
>> +++ b/drivers/gpu/drm/i915/i915_vma.c
>> @@ -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)
>> diff --git a/drivers/gpu/drm/i915/i915_vma.h b/drivers/gpu/drm/i915/i915_vma.h
>> index 67ae7341c7e0..8e74972fdca3 100644
>> --- a/drivers/gpu/drm/i915/i915_vma.h
>> +++ b/drivers/gpu/drm/i915/i915_vma.h
>> @@ -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
> 

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

end of thread, other threads:[~2022-05-04 12:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-02  3:43 [PATCH] drm/i915: use IOMEM_ERR_PTR() directly Kefeng Wang
2022-05-02  8:30 ` Jani Nikula
2022-05-04 12:11   ` Tvrtko Ursulin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).