From patchwork Fri Jul 22 15:48:25 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 9243809 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 6689D60756 for ; Fri, 22 Jul 2016 15:48:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 584A026246 for ; Fri, 22 Jul 2016 15:48:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4CEC627FA7; Fri, 22 Jul 2016 15:48: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=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E68AD26246 for ; Fri, 22 Jul 2016 15:48:43 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1DC226EBEF; Fri, 22 Jul 2016 15:48:40 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mout.web.de (mout.web.de [212.227.15.4]) by gabe.freedesktop.org (Postfix) with ESMTPS id C633D6EBEF for ; Fri, 22 Jul 2016 15:48:36 +0000 (UTC) Received: from [192.168.1.2] ([77.182.75.73]) by smtp.web.de (mrweb001) with ESMTPSA (Nemesis) id 0MAdb9-1bbOSn3RJz-00BvNb; Fri, 22 Jul 2016 17:48:26 +0200 Subject: [PATCH 2/4] GPU-DRM-Etnaviv: Delete unnecessary if statement in __etnaviv_gem_new() To: dri-devel@lists.freedesktop.org, Christian Gmeiner , David Airlie , Lucas Stach , Russell King References: <5307CAA2.8060406@users.sourceforge.net> <530A086E.8010901@users.sourceforge.net> <530A72AA.3000601@users.sourceforge.net> <530B5FB6.6010207@users.sourceforge.net> <530C5E18.1020800@users.sourceforge.net> <530CD2C4.4050903@users.sourceforge.net> <530CF8FF.8080600@users.sourceforge.net> <530DD06F.4090703@users.sourceforge.net> <5317A59D.4@users.sourceforge.net> <00ca5af9-674a-73ce-b423-1ce41d426942@users.sourceforge.net> From: SF Markus Elfring Message-ID: Date: Fri, 22 Jul 2016 17:48:25 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2 MIME-Version: 1.0 In-Reply-To: <00ca5af9-674a-73ce-b423-1ce41d426942@users.sourceforge.net> X-Provags-ID: V03:K0:YYoPISyaL/KeGqPVxBhBOZSL0Nbe2XRRrZoSVdshFFruhF/PaTA G5ME51I/X9mXzCxkoXOVabmxIE/2xPCbIj4e6Z44uEShSuJ5SoEzmkWm8Y/OM51UFZzv7Yj 4m8VckUM1wHp0V/FOIZ4PiZSX2w4WpHou84YvEAk3xYegIl3ih68+rYxO0D3iat0OqRtWnW 3cFxK+ExY9Dej5qB0F+5w== X-UI-Out-Filterresults: notjunk:1; V01:K0:Nj/zaW0s88I=:RGjY3oZgKLWSGP/Wdc0IHJ 1l+EKtziv86E4JKp89UkjJubn6WPkDqs/lB+uPl/wH2CbeoeBu3odSupSrtrMxKKAvuLsIltF xT+oow7LQKRnW70URmmWU6jUH8yAVVpa5BWtsXJ9B3SLKyBbCIYAaVw/ycDMP6Kx1n4PIUj0R 69ELovVBxbmMxPEdzfKxFeq6A0JW/VKaVS1SNy2PTMeorGBkejdvcQw0IdqGwW0ObDg8lBF2N NleCmCfkybyG/vIafsmyGYVhOXgbWgv6t9sNvh5Bcpo96B747u/lbeholvyYl5gSuRe5AkuUd Hzzm9PTyTzyWRuxa4ij3i+KLAtaR0MAdkNbvOphE919H0Oc4wEilmrQ9LJfTkR1V2KzdJTYx2 uMPyxTGhPV2NtEl9wxHXJSo6J9WdiTacKe7oTZamnpJTQYY7LFohYmAReGoDXn2I3jt8O1fQw zIvkmKNn2KPuBuo9eDxipf1gcGRzn/ZeNR+OD58bOExeYoTUPBb1ayqRL3jqE/lE7WkhECxU8 NsTg1xDaSe8O2wy8V16fQit3aGb7qiZ2WgeiOb+k+zi6EczLt3gczPBOp5bbcEO77OmnZOy9P H8xxVRve0gVXpOFn7+F62boelb90MKijuUR/Tb/U356Szk38Ul0I4vLXfENGAFTLt4/fZMZPN qQiPLWacE7ogH9Ea+YEKFwCrSttqA2FFtYM5+TzFFS+jmBuiQmC53Jw1R6GgR9isov2ZaMeth +LmjfJR6Ez5q9rpU9bMYFAdEcEmgnnhygpLN/JZVxCUg2Jrjaali/5hJQksI8z+fCv4Z1fuFy uX8mwx9 Cc: Julia Lawall , kernel-janitors@vger.kernel.org, LKML 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: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Fri, 22 Jul 2016 16:45:22 +0200 Move a return statement into a block for successful function execution. Omit a duplicate check for the local variable "ret" then at the end. Signed-off-by: Markus Elfring --- drivers/gpu/drm/etnaviv/etnaviv_gem.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gem.c b/drivers/gpu/drm/etnaviv/etnaviv_gem.c index 8eee742..851a8ba 100644 --- a/drivers/gpu/drm/etnaviv/etnaviv_gem.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_gem.c @@ -661,13 +661,9 @@ static struct drm_gem_object *__etnaviv_gem_new(struct drm_device *dev, */ mapping = obj->filp->f_mapping; mapping_set_gfp_mask(mapping, GFP_HIGHUSER); + return obj; } - if (ret) - goto fail; - - return obj; - fail: drm_gem_object_unreference_unlocked(obj); return ERR_PTR(ret);