From patchwork Mon May 15 13:44:34 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gustavo Padovan X-Patchwork-Id: 9726999 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 5C1F76028A for ; Mon, 15 May 2017 13:44:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4C230285E4 for ; Mon, 15 May 2017 13:44:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 408AD285EA; Mon, 15 May 2017 13:44:44 +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 D45D2285E4 for ; Mon, 15 May 2017 13:44:43 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2BAF96E208; Mon, 15 May 2017 13:44:43 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qt0-f196.google.com (mail-qt0-f196.google.com [209.85.216.196]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9ADA46E208 for ; Mon, 15 May 2017 13:44:41 +0000 (UTC) Received: by mail-qt0-f196.google.com with SMTP id l39so15558351qtb.1 for ; Mon, 15 May 2017 06:44:41 -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=hDbUcFOO5KbQT2fZDfRqQ83pl2M1rPUaWEcNd0rd38ehAXPWCebkuzhcxiSRHAB/Gy lTLxwHbiFaDzWRjeWgEw2DnNZgpf+/LPCQ0bUxX6ng9Iv6YsmMmyEzKQhwHsGG3md6ap uNu7JRPe938oyvx4a1lEYG9KCYKSGoDU8NTymy3TK9hM/u48zrDEaqQhQCUgU+7PK7HW MV08kdUgL6wz+qkoq3pnyowx7bNOP/gKcQaMpCGEzkaUNiDyrAyQ8Fi6c5u8R0fanQLY 7DtGFE/92A1CH1Bcoceo9qD8+Ehl2GrCz6qfEm2NsjunorEhVuYGzfZZhGyNX+nIzmYu I2cg== X-Gm-Message-State: AODbwcCaWt+uaMfPYZB0U4ksDhnixXUqneWOyoJ7SbNgw1NqcoLP+U31 hwIGLqCpK/r0SQ== X-Received: by 10.200.8.187 with SMTP id v56mr1637015qth.213.1494855879823; Mon, 15 May 2017 06:44:39 -0700 (PDT) Received: from localhost.localdomain (177.18.9.71.dynamic.adsl.gvt.net.br. [177.18.9.71]) by smtp.gmail.com with ESMTPSA id g185sm8203198qkc.7.2017.05.15.06.44.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 May 2017 06:44:39 -0700 (PDT) From: Gustavo Padovan To: dri-devel@lists.freedesktop.org Subject: [PATCH] drm/virtio: remove not needed 'ret' var Date: Mon, 15 May 2017 10:44:34 -0300 Message-Id: <20170515134434.3428-1-gustavo@padovan.org> X-Mailer: git-send-email 2.9.3 Cc: Gustavo Padovan 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);