Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753990AbeAGNfE (ORCPT + 1 other); Sun, 7 Jan 2018 08:35:04 -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 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-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 8bit 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-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: 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; } /* -- 2.15.1