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: 10075107 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 3EECC60383 for ; Sat, 25 Nov 2017 20:46:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3166828A0A for ; Sat, 25 Nov 2017 20:46:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2654A28E02; Sat, 25 Nov 2017 20:46:53 +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 C16BE28A0A for ; Sat, 25 Nov 2017 20:46:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751557AbdKYUqv (ORCPT ); Sat, 25 Nov 2017 15:46:51 -0500 Received: from mout.web.de ([212.227.17.11]:64334 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751439AbdKYUqu (ORCPT ); Sat, 25 Nov 2017 15:46:50 -0500 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 Cc: LKML , kernel-janitors@vger.kernel.org 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= 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: 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,