From patchwork Sat Nov 25 20:46:39 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 10075105 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 6246D60383 for ; Sat, 25 Nov 2017 20:46:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 53D6F28A0A for ; Sat, 25 Nov 2017 20:46:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 469C428E02; Sat, 25 Nov 2017 20:46:51 +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]) (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 D75A728A0A for ; Sat, 25 Nov 2017 20:46:50 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 346E96E14B; Sat, 25 Nov 2017 20:46:50 +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.17.11]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6160A6E14B for ; Sat, 25 Nov 2017 20:46:48 +0000 (UTC) Received: from [192.168.1.3] ([92.228.138.71]) by smtp.web.de (mrweb103 [213.165.67.124]) with ESMTPSA (Nemesis) id 0LsQTc-1fFvlQ3XIW-0122dk; Sat, 25 Nov 2017 21:46:41 +0100 Subject: [PATCH 3/5] video: smscufx: Return an error code only as a constant in ufx_realloc_framebuffer() From: SF Markus Elfring To: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, Bartlomiej Zolnierkiewicz , Steve Glendinning References: Message-ID: <4bc004f9-b7b1-bcf6-de3b-32042a510144@users.sourceforge.net> Date: Sat, 25 Nov 2017 21:46:39 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: Content-Language: en-GB X-Provags-ID: V03:K0:1nc25GkXuDkCxqOG9YpF3KGMSduNPH2l9PlqJCbjoGgIkFQ/f77 5oYLitjlD88DckLyszzRTHt1NZLonC0Q86SetFwgWA8eeavTxPE0918I3GyFxOA/cBARLht qlB4zTVfGTt7FErQn/nQvXgQMb39syTC6rM6um3nrPBjtmjZ+J8wuaFaFQ9H6jXDiIUkZ0D blmAqGOq85LtZfmPnAoJA== X-UI-Out-Filterresults: notjunk:1; V01:K0:So1BXbmtwds=:GTIwsAj2gGpqm6JQwTtNDJ 86CxpvWNWMCGM9TYG2I4i5R0K8nnpigJ8+zvwgh9qzRRWLL5/jLiwLegL0o4TLnGPdsoG7pOI IFAhOmEEf3sxZLhOsceli8d63bGrgAzTFXeR0UTaLBD2y01X4gHLsGTHS/AUsD1JkHASXqRXc WdS9DpEKjC+tO+OgqGkLr+Q1/jFDZ1fQrYRms0MX5ITs2fmAsB8PdY8TVEDnsS8HfgpxAAVBh q07yWzcUz/JlwSM8Rf1dMZ2UtTdcc/Teq+9rpe9es4qRHR1RuFgd5b9MumlfF6bjwuRPNfdAm xzSOOmCZraSzc5we68d3fa377DuUF/r44LLqn7h566ZeW73pByNmLycTvsIg4A5jgkBVa7IcA DLb7KoF6wM8dbQvD8i9NPXGluv4ZdpoB3Q2ypBZfanqJzwGKL8t4iK38vuyUhcW2hiIQTu+mk rPJQfIfKRCJNELsoE1K7zZo6howhT8Rd+Pd/hbF8xi9J4j37dhNwptVq6qVUVDOzQhM7/2Vzt x4K43T9bwhTqdaOXNm+ukDHPoGhGhDBykoC12fzgmNPW0hXxlsf0xHN6zIs4WWdVeXpUHDYi4 P9ZTKtnQ5yIahsWdE5KilWcWfex3YciGRBHyRq828DT3J5Nqx0offl1zgtNphYGbBEmmPGEEc ysbTgm15G1XhJIUGMHLH/OJ+tMS5POjtEiX22lVTXRxd/2Yj8sEK7XtITVaBZu4XgSxoylOYW DRTWcKu3HjRql798YHMcnnEdEz3/0idUI+8+BOohpNgnNPLAlzOF+REQpVtbq5KVlsOdWomKq C8SQCDW/Wvzicitqt187xxGSjHnzl4dZx6OW8+mFGBlczhjN30= Cc: 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: Sat, 25 Nov 2017 19:56:44 +0100 * Return an error code without storing it in an intermediate variable. * Delete the label "error" and local variable "retval" which became unnecessary with this refactoring. Signed-off-by: Markus Elfring --- drivers/video/fbdev/smscufx.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/video/fbdev/smscufx.c b/drivers/video/fbdev/smscufx.c index 08271dafd138..c77fc45a76fc 100644 --- a/drivers/video/fbdev/smscufx.c +++ b/drivers/video/fbdev/smscufx.c @@ -1294,7 +1294,6 @@ static struct fb_ops ufx_ops = { * Assumes no active clients have framebuffer open */ static int ufx_realloc_framebuffer(struct ufx_data *dev, struct fb_info *info) { - int retval = -ENOMEM; int old_len = info->fix.smem_len; int new_len; unsigned char *old_fb = info->screen_base; @@ -1310,7 +1309,7 @@ static int ufx_realloc_framebuffer(struct ufx_data *dev, struct fb_info *info) */ new_fb = vmalloc(new_len); if (!new_fb) - goto error; + return -ENOMEM; if (info->screen_base) { memcpy(new_fb, old_fb, old_len); @@ -1322,11 +1321,7 @@ static int ufx_realloc_framebuffer(struct ufx_data *dev, struct fb_info *info) info->fix.smem_start = (unsigned long) new_fb; info->flags = smscufx_info_flags; } - - retval = 0; - -error: - return retval; + return 0; } /* sets up I2C Controller for 100 Kbps, std. speed, 7-bit addr, master,