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: 10148365 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 808D96037E for ; Sun, 7 Jan 2018 16:04:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6E5D528595 for ; Sun, 7 Jan 2018 16:04:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 629CE285D5; Sun, 7 Jan 2018 16:04:15 +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 023E728595 for ; Sun, 7 Jan 2018 16:04:14 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 11FEC6E527; Sun, 7 Jan 2018 16:04:14 +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.3]) by gabe.freedesktop.org (Postfix) with ESMTPS id BE2366E527 for ; Sun, 7 Jan 2018 16:04:12 +0000 (UTC) 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 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= 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: 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,