From patchwork Sun Jan 7 16:04:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 10148385 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 58F846037E for ; Sun, 7 Jan 2018 16:06:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 47C592861C for ; Sun, 7 Jan 2018 16:06:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3A40B28856; Sun, 7 Jan 2018 16:06:13 +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=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D80EE2861C for ; Sun, 7 Jan 2018 16:06:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754024AbeAGQF5 (ORCPT ); Sun, 7 Jan 2018 11:05:57 -0500 Received: from mout.web.de ([212.227.15.3]:64347 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754149AbeAGQEP (ORCPT ); Sun, 7 Jan 2018 11:04:15 -0500 Received: from [192.168.1.3] ([78.48.134.178]) by smtp.web.de (mrweb002 [213.165.67.108]) with ESMTPSA (Nemesis) id 0MbQfs-1eHdwo0Dw4-00IkAJ; Sun, 07 Jan 2018 17:04:06 +0100 Subject: [PATCH v3 2/3] 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 Cc: LKML , kernel-janitors@vger.kernel.org References: <1736749.UIs06O4xc5@amdc3058> Message-ID: <31ecfef4-a193-dea0-0ff3-0d5a108a14f3@users.sourceforge.net> Date: Sun, 7 Jan 2018 17:04:04 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: Content-Language: en-GB X-Provags-ID: V03:K0:l+5MaVjsABHxfDL8QmFeeAPcHBU0WPi/VsCiQT3dyVwvIIuR8XP v5NFyXB5KOZr8608OLVJ4WmjrJO1BjJ9Nqh2mEMJN5CdlL0om7NwsNw8odNLiqL0ffOvZGF 3NijEC83K6vb7poiKMbxAXVXwoFcxzWcghVHV65pP5mOROS71GIpzIDgzueXxaceOT0/Gm8 qrsacFWGzYPvenRhfB0XA== X-UI-Out-Filterresults: notjunk:1; V01:K0:JOj4YodRzM8=:gupNfj2kk1OGY2m+fKP09+ G97BUzHpYPM0ObZCFsMwGRMF3Au4njznTfDrZfne5g2M+Bu+JTM2ng55fkXfpMwK4D9j7lBSj ZR9K4FY/ei7xDMIxWcFB4OAD8fPxmVgval/lUTESAWdeDXT1iex3CszEkD2J8kiNf7K/ols4h CpoOJrjqouwNiEkfdntvgIe0nN3hA+hR/VsUZNVAOpG6iiiX70+OWxartkxc4Sa7jHlRZvDt7 GJe3aUiIoF+R+YucCV779jqGPRuWswBwYG1lbDdUirpXNuLeHKHx7SmSWZSelEoFVAUdYUqCM HK+TF/vOeeI89C03d3T60jEy03GuvD85hvsRZITznYJX0eEB5yin2Co4vh6aGIAcVnUR/nVi9 TX+PKYaif6tYv313FSSuEXry25isNbez5jUWtMsRTNm8wFOOfup4w7g9hWdBelrg4WSTpjTRn uW7hVkmbUWoWN8uHZ7vMqkfL+GEepiHY8qpL5O20BDu4PRi4gUGe+BouhaY+g/Fw7gQSPWhW9 P0qgM4vA7bi7iH7s8eWgN/U28Lxez7ipIZiyYD6Q2qsdcrWVKFuw4wno+w5fem+1awQF5mMVd 5drGC5u9mhLVJ9eioHlzL2fYiCbAaWmAH4VDSRh4Hh15mUoEz+cJonM88DA2mdtvWLP2m1TYy Rqu1y53kgb4IMs45ivGnGvTU5tma4o6Z1qX8TITkvkLi21+0Hltj1EZ5jzdrslBQp3MRVilxB mgU7GMWNuxOKxedBVK+Sqtkdd7Ah37dwEuMJoca/S5U9Bv/UUqGX8GBk/Rj69ztxOzqcX1sMv ziAGRoQAcCp1H7CKm/xyeS6aXcDKC+pMXyKuL2/zT8/VF/iV14= Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Sun, 7 Jan 2018 16:07:11 +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 --- v3: This update suggestion was rebased on source files from the software "Linux next-20180105". 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 893daeb1ffd9..abbded605d68 100644 --- a/drivers/video/fbdev/smscufx.c +++ b/drivers/video/fbdev/smscufx.c @@ -1293,7 +1293,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) { pr_err("Virtual framebuffer alloc failed"); - goto error; + return -ENOMEM; } if (info->screen_base) { @@ -1323,11 +1322,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,