From patchwork Fri Nov 24 20:51:13 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: 10074577 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 452D260383 for ; Fri, 24 Nov 2017 20:51:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3682A2A246 for ; Fri, 24 Nov 2017 20:51:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2B4E92A248; Fri, 24 Nov 2017 20:51:25 +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 DB3F22A246 for ; Fri, 24 Nov 2017 20:51:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753769AbdKXUvY (ORCPT ); Fri, 24 Nov 2017 15:51:24 -0500 Received: from mout.web.de ([212.227.15.4]:59292 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753709AbdKXUvX (ORCPT ); Fri, 24 Nov 2017 15:51:23 -0500 Received: from [192.168.1.3] ([78.53.250.25]) by smtp.web.de (mrweb002 [213.165.67.108]) with ESMTPSA (Nemesis) id 0LshCr-1fFz351uKv-012Jm7; Fri, 24 Nov 2017 21:51:14 +0100 Subject: [PATCH 2/4] video: udlfb: Return an error code only as a constant in dlfb_realloc_framebuffer() From: SF Markus Elfring To: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, Bartlomiej Zolnierkiewicz , Bernie Thompson Cc: LKML , kernel-janitors@vger.kernel.org References: <6fb11bb4-2c1d-a939-087b-de31c42328b9@users.sourceforge.net> Message-ID: <65441eb1-3a22-27ad-b9af-03111855a6e6@users.sourceforge.net> Date: Fri, 24 Nov 2017 21:51:13 +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: <6fb11bb4-2c1d-a939-087b-de31c42328b9@users.sourceforge.net> Content-Language: en-GB X-Provags-ID: V03:K0:gVzB5byuJw9vnA2PYJfcQUHNayXf/DP+yPPE4oB9KgeM9rSNhOE N8z/D+P64k+Rydgs8/uX4XEYgQxaTHxuEKmaF+9dFx+6oPyFRmAcCD/liM8XN58EAY0bwkK JEE13tZRdVpvyQw4PyqJcxhrCobT/DpSm6N50Ez4p+wt2xx4mMM7tWWE6ASIDeH21Y+AKo7 sFzjHx0T4kUk3f/RdT5kA== X-UI-Out-Filterresults: notjunk:1; V01:K0:HlutarSCDYA=:ryzfLuV1YXIYa0yPj3IWNR IZRzQiMn44fdlAEDRZnQ0Bv3ukmYehaTVMiwkyi+41piafENPXTA2TGOdFvPp5kGsByBeGKMH BsI1gb893BXKHvpZo1SHI3X6T7OKcmnO4n00EjDAciRZN0LqzRiUCR8G/gK5FU5WrObsB1CcA Tu0m//VtdwCatceKr/BJW8/eowMokEh33e9c66hzduwIdzaRHKnXjco8Shm5OTYWSKxTgDFGf fzpamVPnvHYDHXi3DbupTWsjj83SLMgno0NIphiUewPEktudmGOVQHDs1qDO0PYAhG20FfV8z h6WzYI3DGE/TU8bCF/ibPsmIVT2vceC1FLU8ErzTgI5NfkMADLUFUhucBbiTQ3H4eMGFYotUv B5UvIXpHv6hzEpG5EhH8a9t9xwhZcn6UmCpz1QFSflLbCvgvrRN5eni/WjBBJ/tYl0EWAHA0T 60S6voPXWUEadOnu9sPZl7M9E9f0HQCYAFPee42hQK3TvxO57Zr78zeyftpC/pLAJBWh/MHTA 8X763l/HPtQtuYYPL7UcGd6am6f3ZgeD+SHzjRml5oTRyWQY466YIWLcR+ufp1O6Txow+Sa6L cTDQRiKYFyQ+pyeTpPwvxLu/J1DVoXfWrxcG4qro1OzyMBZy+kgFg/xw4PlGBFrWqH/K69opt DjSaPmF6MoJjJqBEiEkPj1onBbh66iqD5iaBShVbzuDFAxynY1VyF1DLrKaLcd8QH8hO56Be4 g9h+wTbpB2QXiNdUAERayGlWaOO8RmBKXGr5v3AVKybaNeTH1DJDQcdBlUh5YsM8FCnCvALg5 +A1bJRgj0N8+n8zaEiIFm9Ybn0EVJvfJOJz9Xmtl0bN3yv3KVg= 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: Fri, 24 Nov 2017 21:22:25 +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/udlfb.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/video/fbdev/udlfb.c b/drivers/video/fbdev/udlfb.c index 77633c58bb9b..cb2d59ca67a4 100644 --- a/drivers/video/fbdev/udlfb.c +++ b/drivers/video/fbdev/udlfb.c @@ -1159,7 +1159,6 @@ static struct fb_ops dlfb_ops = { */ static int dlfb_realloc_framebuffer(struct dlfb_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; @@ -1176,7 +1175,7 @@ static int dlfb_realloc_framebuffer(struct dlfb_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); @@ -1203,11 +1202,7 @@ static int dlfb_realloc_framebuffer(struct dlfb_data *dev, struct fb_info *info) dev->backing_buffer = new_back; } } - - retval = 0; - -error: - return retval; + return 0; } /*