From patchwork Sun Dec 8 10:53:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukas Bulwahn X-Patchwork-Id: 11278857 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EB0851575 for ; Mon, 9 Dec 2019 09:47:55 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D3EFC2176D for ; Mon, 9 Dec 2019 09:47:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D3EFC2176D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 43BB06E393; Mon, 9 Dec 2019 09:47:13 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-ed1-x543.google.com (mail-ed1-x543.google.com [IPv6:2a00:1450:4864:20::543]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9A42B6E046 for ; Sun, 8 Dec 2019 10:53:47 +0000 (UTC) Received: by mail-ed1-x543.google.com with SMTP id c93so9804235edf.7 for ; Sun, 08 Dec 2019 02:53:47 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=RP445oumAyApvuuzSY5LdqaN1csStiseBJ96Rg6gPzY=; b=EC799Tc0Y8hlcFWetxULglL40n9YHNZSbpmS6GLnQosBNdLcQuPMhsebD01iOtSnl3 cFMNu6NnLSCj0M9i3WCkQXb/cQKqZm/BVNO/Ugxr7loaZC47Cv4fKcfaAdHHBkrQFa8N DVh/v/bB+soQlRwVazHLA3mZcgjifptlJwW7Giu70FwQGCsCZEH+EyZUwd+eWycAl4Vx PFff7x9ZBwSU6LY15X2DX6Fl3w4O4MnKZmZK+yGneqAv3B4/+G5zAQfHX7OZTnKcKjjC cQzpmrwsZf+CAKRi0T+NwO+IhnvGtLDPvMELsMfZsqtiobr0rrCS1tB5LGrSFWg8jBWf T+hw== X-Gm-Message-State: APjAAAWzP+pd8VrO4Q793sMEqgLy/WFKKHbmcVisS7OLwcL9f7fmkkEG jogFOv5eZ+MPJWdVOLCY+hM= X-Google-Smtp-Source: APXvYqzKoOx2EKgpyTltHK8dmjzErAfRzYlsPNKZioPwoWXHOiOXc5mrHf/bkUbH3tGhwIA1AuppsQ== X-Received: by 2002:a17:906:489:: with SMTP id f9mr3125363eja.27.1575802426107; Sun, 08 Dec 2019 02:53:46 -0800 (PST) Received: from felia.fritz.box ([2001:16b8:2d4e:6900:458f:723c:bc3a:78f2]) by smtp.gmail.com with ESMTPSA id y2sm23487eds.24.2019.12.08.02.53.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 Dec 2019 02:53:45 -0800 (PST) From: Lukas Bulwahn To: Thomas Hellstrom , dri-devel@lists.freedesktop.org Subject: [PATCH] drm/vmwgfx: Replace deprecated PTR_RET Date: Sun, 8 Dec 2019 11:53:28 +0100 Message-Id: <20191208105328.15335-1-lukas.bulwahn@gmail.com> X-Mailer: git-send-email 2.17.1 X-Mailman-Approved-At: Mon, 09 Dec 2019 09:46:36 +0000 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=RP445oumAyApvuuzSY5LdqaN1csStiseBJ96Rg6gPzY=; b=FzcV8FNtYmwMpIO5ZRZ+YPRdcqZbrZEaM8iT05KkoBBtA4hwIvPRExCm6EQhLvf0/V 6vxpkRmZfssCaMMnMEL3rXS6onfm4++nKYeJ7D1NOGhAWtQZpLkdKfKzjNE0A2uwkurO hSHGuxD863rSL6sAYLmEf1oUo6F1oVgBe5zrhuwVs6nncN/pbr0EFL/+K4f6I3mURkrd WkWhK68eEZXqMwS7yc/J0sPi9LDEjDX3zfTa7f6ckm6RAGLHXGxQlwvtPViYAiBeCSmI f8P3/JfazNb7BMSYxNG6oJUrjVWO4KOw7PWQvK0/FphAGft8QoNSCK0oR+dMLmBGaqav kV+Q== X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sinclair Yeh , David Airlie , kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org, linux-graphics-maintainer@vmware.com, Lukas Bulwahn MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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. Signed-off-by: Lukas Bulwahn Reviewed-by: Thomas Hellstrom --- 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); } /**