Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754321AbeAGQF6 (ORCPT + 1 other); Sun, 7 Jan 2018 11:05:58 -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 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-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 8bit 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-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: 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, -- 2.15.1