From patchwork Sun Apr 9 23:58:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gustavo Padovan X-Patchwork-Id: 9671825 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 97F1E602B6 for ; Sun, 9 Apr 2017 23:59:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 800AB27D29 for ; Sun, 9 Apr 2017 23:59:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 74DA227F88; Sun, 9 Apr 2017 23:59:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.7 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 6CD9B27F89 for ; Sun, 9 Apr 2017 23:59:05 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5C9D06E04A; Sun, 9 Apr 2017 23:59:03 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm0-f65.google.com (mail-wm0-f65.google.com [74.125.82.65]) by gabe.freedesktop.org (Postfix) with ESMTPS id CEB246E04A for ; Sun, 9 Apr 2017 23:59:01 +0000 (UTC) Received: by mail-wm0-f65.google.com with SMTP id x75so6960277wma.1 for ; Sun, 09 Apr 2017 16:59:01 -0700 (PDT) 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=mcdspMxIHHKOuMsAzObdaIqVNxd1ZNXNbUF1frs0BNI=; b=N7x+sjY6bdhLz/guX6HjOIihAs67gvkLTKaBudv8I3ifdw6uBmPL8RKKKafRVYvUSD heCgzl9rGapLYUhTCmrxbDhJm3lVdDnug8e4PsipOazSTJIiDwYOsiHVLt9cd7enBV52 S8rqANOyp+CTwL+iikR+32G8NKtV87aQp2Eo6l1av8O52ydnSTD0vRUrI8oUlgz7axSm VoUZVWwojuCUPSlFL5ia7hCQ1QhnPnfOmsWnZ6xxEE+JPXuP2kEjf5lrMnjWE/mbzGFZ lVrHXrxA3zfUUxs6Ow2bP3S/cS8piUlv4Wqgo4L0vvRRPkbh1kIEYiRmnn7ddcE2HMvA bbvA== X-Gm-Message-State: AN3rC/7JoWXYR+KCXZAh/C4jwCufznRRJ/iAuSfrWTpCHtyjYCR4NlMDwrK+ERpfgQsBPA== X-Received: by 10.28.97.2 with SMTP id v2mr6887568wmb.88.1491782340501; Sun, 09 Apr 2017 16:59:00 -0700 (PDT) Received: from localhost.localdomain ([79.143.138.42]) by smtp.gmail.com with ESMTPSA id 140sm8065994wmk.12.2017.04.09.16.58.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 09 Apr 2017 16:58:59 -0700 (PDT) From: Gustavo Padovan To: dri-devel@lists.freedesktop.org Subject: [PATCH] drm/virtio: remove not needed 'ret' var Date: Mon, 10 Apr 2017 01:58:57 +0200 Message-Id: <20170409235857.7828-1-gustavo@padovan.org> X-Mailer: git-send-email 2.9.3 Cc: Gustavo Padovan , Gerd Hoffmann X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Gustavo Padovan virtio_gpu_cursor_plane_update() doesn't need to know the exact value of virtio_gpu_object_reserve() return, just if it is zero or not. Thus just use the function direct in the return. Signed-off-by: Gustavo Padovan --- drivers/gpu/drm/virtio/virtgpu_plane.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/gpu/drm/virtio/virtgpu_plane.c b/drivers/gpu/drm/virtio/virtgpu_plane.c index adcdbd0..76d5fed 100644 --- a/drivers/gpu/drm/virtio/virtgpu_plane.c +++ b/drivers/gpu/drm/virtio/virtgpu_plane.c @@ -197,7 +197,6 @@ static void virtio_gpu_cursor_plane_update(struct drm_plane *plane, struct virtio_gpu_fence *fence = NULL; struct virtio_gpu_object *bo = NULL; uint32_t handle; - int ret = 0; if (plane->state->crtc) output = drm_crtc_to_virtio_gpu_output(plane->state->crtc); @@ -221,8 +220,7 @@ static void virtio_gpu_cursor_plane_update(struct drm_plane *plane, cpu_to_le32(plane->state->crtc_w), cpu_to_le32(plane->state->crtc_h), 0, 0, &fence); - ret = virtio_gpu_object_reserve(bo, false); - if (!ret) { + if (!virtio_gpu_object_reserve(bo, false)) { reservation_object_add_excl_fence(bo->tbo.resv, &fence->f); dma_fence_put(&fence->f);