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: 10074575 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 4FA6460383 for ; Fri, 24 Nov 2017 20:51:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3ED522A246 for ; Fri, 24 Nov 2017 20:51:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 312A32A248; Fri, 24 Nov 2017 20:51:24 +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 C9C622A246 for ; Fri, 24 Nov 2017 20:51:23 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 30CA56EA04; Fri, 24 Nov 2017 20:51:23 +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.4]) by gabe.freedesktop.org (Postfix) with ESMTPS id E06E56EA04 for ; Fri, 24 Nov 2017 20:51:20 +0000 (UTC) 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 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= 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: 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; } /*