From patchwork Sun Jan 7 13:34:51 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: 10148297 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 3EF93601A1 for ; Sun, 7 Jan 2018 13:35:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2FE3D287A6 for ; Sun, 7 Jan 2018 13:35:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 248C428856; Sun, 7 Jan 2018 13:35:18 +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 CDE0F287A6 for ; Sun, 7 Jan 2018 13:35:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753958AbeAGNfD (ORCPT ); Sun, 7 Jan 2018 08:35:03 -0500 Received: from mout.web.de ([212.227.15.3]:59201 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753891AbeAGNfC (ORCPT ); Sun, 7 Jan 2018 08:35:02 -0500 Received: from [192.168.1.3] ([78.48.134.178]) by smtp.web.de (mrweb001 [213.165.67.108]) with ESMTPSA (Nemesis) id 0LtFEp-1f0gKc0YDz-012q9M; Sun, 07 Jan 2018 14:34:53 +0100 Subject: [PATCH v2 1/2] 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> <1768474.zA76iyE2Y1@amdc3058> <25aee051-12fb-de5f-c806-f419fa4c0ef1@users.sourceforge.net> Message-ID: <632abf1e-8c40-cbd2-4bbe-5dfdf89cb95f@users.sourceforge.net> Date: Sun, 7 Jan 2018 14:34:51 +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: <25aee051-12fb-de5f-c806-f419fa4c0ef1@users.sourceforge.net> Content-Language: en-GB X-Provags-ID: V03:K0:skZJ2pM8f4+bBcCdUFSFAMpNwndVlbmgkCc0X5W9cTL3BoNBh5b DE4GWo1nAeim5MNrCRvFmsL8/21olGoizFtvPzP2KL74MaoUOd/TMhRLyp3hEqsh+xROoLV fz5Kue5qk6GFTVhfyLwvvebqYpOllYGnDdFlYo19AaWYA68a4vJD808K/dCfH1p8nQtCLgP GMmpU4ndXfdGW5lgepBzw== X-UI-Out-Filterresults: notjunk:1; V01:K0:zlPJPvBnV0Y=:ESJL8K8/Ns0nvVovR4XtL6 CsP+Q2t3KOfD+6hKaAolIvOla8BZa5LmDBnunUauqpwg2MtK9IFTA9i1A52vU6e0AXeRwd/l+ Ay/Mw1+2k/Kl/qfBIb/Q5ojurKOM670Mztsno14EFm9ma+QbIYcfWDMeNkd8MMKpYdSpkybMS Xn0emuJX/SMcNwgrMEe2/PqIsLV/Z8DUEkZGXav80w5Sb/ESkByEsreO/qCz302dyb1kzN1tU CKS3imfkI/A9wJCkEH7MgiRr9Y/khAJb1o6yaxHgNIzbgcPb9dFulVcel/sZuKKgnVIi0xOEf s3URiJgFD0Jzpe2W1XowK4+6V1Yzp9DfjG0shasWYW8RODgna5m6xJnE0+2x5+1CpoLnvuFjg 3zriahaPr8+QyUfQ68ZH8dUtvGaitAE2HJP+qe/KFHH9BNbTe+Rkt4NZkllugaO/XAWbRrvQz 8HqqgqM/B2NVh3dw9r5Z3S/MubeHz/sDrArjRwJfEVOtegPaVQZXqaJZz7aseKsAr3hVj69kv P/zSzRyE7DsL9kzpKuk7lGbvhKNxwSZGOTB3sCoAfB/iAn6/HqzyU+3ul7reR6WSbF09JsfSh VTwwvkZ5waJC3fWfx1UUQ14TEGTq3nwfYGQi8KH2dC0vXtPWqrwN/6bOpzhtQf++nFu5MO7+D J4SwsNR0Qm1sqWu6jEGGHxbbRkH66Lw7bhZhBHRxheYQcZgsH/6n9/KECN0yQmA7RMm7czp+F qaN/DYLTyTA7Oo1OTZllsTJFDoCRsUM15c+PfrVTd7czxsc2bkCpYOpNCYNZ4w91sECcSHWBP IH5uJ1jLmRqGWfedf3wD2dka7b4aX8S9KOHVbkCJD3VEIAvHgw= 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: Sun, 7 Jan 2018 14:02:36 +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 --- v2: This update suggestion was rebased on source files from the software "Linux next-20180105". 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 99ce445986b3..560a6b6044a5 100644 --- a/drivers/video/fbdev/udlfb.c +++ b/drivers/video/fbdev/udlfb.c @@ -1157,7 +1157,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; @@ -1175,7 +1174,7 @@ static int dlfb_realloc_framebuffer(struct dlfb_data *dev, struct fb_info *info) new_fb = vmalloc(new_len); if (!new_fb) { pr_err("Virtual framebuffer alloc failed\n"); - goto error; + return -ENOMEM; } if (info->screen_base) { @@ -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; } /*