diff mbox series

drm/v3d: Use v3d_perfmon_find(..)

Message ID 20240923152000.185980-1-christian.gmeiner@gmail.com (mailing list archive)
State New, archived
Headers show
Series drm/v3d: Use v3d_perfmon_find(..) | expand

Commit Message

Christian Gmeiner Sept. 23, 2024, 3:19 p.m. UTC
From: Christian Gmeiner <cgmeiner@igalia.com>

Replace the open coded v3d_perfmon_find(..) with the real
thing.

Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
---
 drivers/gpu/drm/v3d/v3d_perfmon.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

Comments

Maíra Canal Sept. 24, 2024, 11:27 p.m. UTC | #1
Hi Christian,

On 9/23/24 12:19, Christian Gmeiner wrote:
> From: Christian Gmeiner <cgmeiner@igalia.com>
> 
> Replace the open coded v3d_perfmon_find(..) with the real
> thing.
> 
> Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>

Thanks for your patch!

Reviewed-by: Maíra Canal <mcanal@igalia.com>

Applied to misc/kernel.git (drm-misc-next).

Best Regards,
- Maíra

> ---
>   drivers/gpu/drm/v3d/v3d_perfmon.c | 6 +-----
>   1 file changed, 1 insertion(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/v3d/v3d_perfmon.c b/drivers/gpu/drm/v3d/v3d_perfmon.c
> index cd7f1eedf17f..54a486a9b74c 100644
> --- a/drivers/gpu/drm/v3d/v3d_perfmon.c
> +++ b/drivers/gpu/drm/v3d/v3d_perfmon.c
> @@ -402,11 +402,7 @@ int v3d_perfmon_get_values_ioctl(struct drm_device *dev, void *data,
>   	if (req->pad != 0)
>   		return -EINVAL;
>   
> -	mutex_lock(&v3d_priv->perfmon.lock);
> -	perfmon = idr_find(&v3d_priv->perfmon.idr, req->id);
> -	v3d_perfmon_get(perfmon);
> -	mutex_unlock(&v3d_priv->perfmon.lock);
> -
> +	perfmon = v3d_perfmon_find(v3d_priv, req->id);
>   	if (!perfmon)
>   		return -EINVAL;
>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/v3d/v3d_perfmon.c b/drivers/gpu/drm/v3d/v3d_perfmon.c
index cd7f1eedf17f..54a486a9b74c 100644
--- a/drivers/gpu/drm/v3d/v3d_perfmon.c
+++ b/drivers/gpu/drm/v3d/v3d_perfmon.c
@@ -402,11 +402,7 @@  int v3d_perfmon_get_values_ioctl(struct drm_device *dev, void *data,
 	if (req->pad != 0)
 		return -EINVAL;
 
-	mutex_lock(&v3d_priv->perfmon.lock);
-	perfmon = idr_find(&v3d_priv->perfmon.idr, req->id);
-	v3d_perfmon_get(perfmon);
-	mutex_unlock(&v3d_priv->perfmon.lock);
-
+	perfmon = v3d_perfmon_find(v3d_priv, req->id);
 	if (!perfmon)
 		return -EINVAL;