[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1606305704.12702713.1575886917867.JavaMail.zimbra@inria.fr>
Date: Mon, 9 Dec 2019 11:21:57 +0100 (CET)
From: Julia Lawall <julia.lawall@...ia.fr>
To: Lukas Bulwahn <lukas.bulwahn@...il.com>
Cc: Thomas Hellstrom <thellstrom@...are.com>,
dri-devel@...ts.freedesktop.org, David Airlie <airlied@...ux.ie>,
Daniel Vetter <daniel@...ll.ch>,
Sinclair Yeh <syeh@...are.com>,
linux-graphics-maintainer@...are.com,
kernel-janitors@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] drm/vmwgfx: Replace deprecated PTR_RET
> De: "Lukas Bulwahn" <lukas.bulwahn@...il.com>
> À: "Thomas Hellstrom" <thellstrom@...are.com>, dri-devel@...ts.freedesktop.org
> Cc: "David Airlie" <airlied@...ux.ie>, "Daniel Vetter" <daniel@...ll.ch>, "Sinclair Yeh" <syeh@...are.com>,
> linux-graphics-maintainer@...are.com, kernel-janitors@...r.kernel.org, linux-kernel@...r.kernel.org, "Lukas Bulwahn"
> <lukas.bulwahn@...il.com>
> Envoyé: Dimanche 8 Décembre 2019 18:53:28
> Objet: [PATCH] drm/vmwgfx: Replace deprecated PTR_RET
> Commit 508108ea2747 ("drm/vmwgfx: Don't refcount command-buffer managed
> resource lookups during command buffer validation") slips in use of
> deprecated PTR_RET. Use PTR_ERR_OR_ZERO instead.
>
> As the PTR_ERR_OR_ZERO is a bit longer than PTR_RET, we introduce
> local variable ret for proper indentation and line-length limits.
Is 0 actually possible? I have the impression that it is not, but perhaps I missed something.
julia
> Signed-off-by: Lukas Bulwahn <lukas.bulwahn@...il.com>
> ---
> applies cleanly on current master (9455d25f4e3b) and next-20191207
> compile-tested on x86_64_defconfig + DRM_VMWGFX=y
>
> drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c | 21 +++++++++++++++------
> 1 file changed, 15 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c
> b/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c
> index 934ad7c0c342..73489a45decb 100644
> --- a/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c
> +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c
> @@ -2377,9 +2377,12 @@ static int vmw_cmd_dx_clear_rendertarget_view(struct
> vmw_private *dev_priv,
> {
> VMW_DECLARE_CMD_VAR(*cmd, SVGA3dCmdDXClearRenderTargetView) =
> container_of(header, typeof(*cmd), header);
> + struct vmw_resource *ret;
>
> - return PTR_RET(vmw_view_id_val_add(sw_context, vmw_view_rt,
> - cmd->body.renderTargetViewId));
> + ret = vmw_view_id_val_add(sw_context, vmw_view_rt,
> + cmd->body.renderTargetViewId);
> +
> + return PTR_ERR_OR_ZERO(ret);
> }
>
> /**
> @@ -2396,9 +2399,12 @@ static int vmw_cmd_dx_clear_depthstencil_view(struct
> vmw_private *dev_priv,
> {
> VMW_DECLARE_CMD_VAR(*cmd, SVGA3dCmdDXClearDepthStencilView) =
> container_of(header, typeof(*cmd), header);
> + struct vmw_resource *ret;
> +
> + ret = vmw_view_id_val_add(sw_context, vmw_view_ds,
> + cmd->body.depthStencilViewId);
>
> - return PTR_RET(vmw_view_id_val_add(sw_context, vmw_view_ds,
> - cmd->body.depthStencilViewId));
> + return PTR_ERR_OR_ZERO(ret);
> }
>
> static int vmw_cmd_dx_view_define(struct vmw_private *dev_priv,
> @@ -2741,9 +2747,12 @@ static int vmw_cmd_dx_genmips(struct vmw_private
> *dev_priv,
> {
> VMW_DECLARE_CMD_VAR(*cmd, SVGA3dCmdDXGenMips) =
> container_of(header, typeof(*cmd), header);
> + struct vmw_resource *ret;
> +
> + ret = vmw_view_id_val_add(sw_context, vmw_view_sr,
> + cmd->body.shaderResourceViewId);
>
> - return PTR_RET(vmw_view_id_val_add(sw_context, vmw_view_sr,
> - cmd->body.shaderResourceViewId));
> + return PTR_ERR_OR_ZERO(ret);
> }
>
> /**
> --
> 2.17.1
Powered by blists - more mailing lists