From patchwork Wed Jul 1 11:42:46 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudip Mukherjee X-Patchwork-Id: 6702881 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 598869F1C1 for ; Wed, 1 Jul 2015 11:43:00 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9372B20412 for ; Wed, 1 Jul 2015 11:42:59 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id B286F204AF for ; Wed, 1 Jul 2015 11:42:58 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0FD1C6E524; Wed, 1 Jul 2015 04:42:58 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pa0-f49.google.com (mail-pa0-f49.google.com [209.85.220.49]) by gabe.freedesktop.org (Postfix) with ESMTPS id 086E46E524 for ; Wed, 1 Jul 2015 04:42:57 -0700 (PDT) Received: by pacws9 with SMTP id ws9so22461405pac.0 for ; Wed, 01 Jul 2015 04:42:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=A/B5PrBYnsBVPFbQabq7nQiNbp1Pwhhx0T0648ecPPo=; b=08AvbDbtMkLkAob9IgqPnXerW8rGnP6vHZbQD5bFsP6hfDoAiiNmhPiec8SVckrd6c 6xceYMmjKcz9vpOj8tn1sn3O1kM9EarDMRYLLORKjE2/rQZXNgdJ+WG4GC/bOC5lyj2l AasONmHoO7csNio3CyTvep1DUvXGcszv3k1djnkaFqVFmxkSMzxBD8sx+k3mRcZ/lc+O 9JV4u2NVzMDCgZpA5Z8y16xngi9I8ZW/9FnNQ2yiIqi2zUe57dEw2SPkKDZ1OoBgVwrw 2gmqFDCL3tTWXFv6+ZyObwrVKZkEai3+vhmNDCZlEdVyixcWRZB+558Y0l5WRotGeS0q hWDw== X-Received: by 10.68.219.42 with SMTP id pl10mr54697530pbc.154.1435750976764; Wed, 01 Jul 2015 04:42:56 -0700 (PDT) Received: from localhost.localdomain ([49.206.246.100]) by mx.google.com with ESMTPSA id eu5sm2032543pac.37.2015.07.01.04.42.54 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 01 Jul 2015 04:42:56 -0700 (PDT) From: Sudip Mukherjee To: David Airlie Subject: [PATCH 2/2] drm/mgag200: remove unneeded variable Date: Wed, 1 Jul 2015 17:12:46 +0530 Message-Id: <1435750966-2922-2-git-send-email-sudipm.mukherjee@gmail.com> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1435750966-2922-1-git-send-email-sudipm.mukherjee@gmail.com> References: <1435750966-2922-1-git-send-email-sudipm.mukherjee@gmail.com> Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Sudip Mukherjee 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-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP ttm_bo_validate() returns 0 or error. So we can return the value directly and remove the variable 'ret'. Signed-off-by: Sudip Mukherjee --- drivers/gpu/drm/mgag200/mgag200_ttm.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/mgag200/mgag200_ttm.c b/drivers/gpu/drm/mgag200/mgag200_ttm.c index d16964e..05108b5 100644 --- a/drivers/gpu/drm/mgag200/mgag200_ttm.c +++ b/drivers/gpu/drm/mgag200/mgag200_ttm.c @@ -378,7 +378,7 @@ int mgag200_bo_pin(struct mgag200_bo *bo, u32 pl_flag, u64 *gpu_addr) int mgag200_bo_unpin(struct mgag200_bo *bo) { - int i, ret; + int i; if (!bo->pin_count) { DRM_ERROR("unpin bad %p\n", bo); return 0; @@ -389,11 +389,7 @@ int mgag200_bo_unpin(struct mgag200_bo *bo) for (i = 0; i < bo->placement.num_placement ; i++) bo->placements[i].flags &= ~TTM_PL_FLAG_NO_EVICT; - ret = ttm_bo_validate(&bo->bo, &bo->placement, false, false); - if (ret) - return ret; - - return 0; + return ttm_bo_validate(&bo->bo, &bo->placement, false, false); } int mgag200_bo_push_sysram(struct mgag200_bo *bo)