From: SF Markus Elfring <elfring@users.sourceforge.net>
To: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org,
Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>,
Bernie Thompson <bernie@plugable.com>
Cc: kernel-janitors@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH v2 1/2] video: udlfb: Return an error code only as a constant in dlfb_realloc_framebuffer()
Date: Sun, 07 Jan 2018 13:34:51 +0000 [thread overview]
Message-ID: <632abf1e-8c40-cbd2-4bbe-5dfdf89cb95f@users.sourceforge.net> (raw)
In-Reply-To: <25aee051-12fb-de5f-c806-f419fa4c0ef1@users.sourceforge.net>
From: Markus Elfring <elfring@users.sourceforge.net>
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 <elfring@users.sourceforge.net>
---
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
next prev parent reply other threads:[~2018-01-07 13:34 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20171124204825epcas1p41626d598b6e437dfb4c6b648e3730cc1@epcas1p4.samsung.com>
2017-11-24 20:48 ` [PATCH 0/4] video-UDLFB: Adjustments for five function implementations SF Markus Elfring
2017-11-24 20:49 ` [PATCH 1/4] video: udlfb: Delete an error message for a failed memory allocation in two functions SF Markus Elfring
2017-11-24 20:51 ` [PATCH 2/4] video: udlfb: Return an error code only as a constant in dlfb_realloc_framebuffer() SF Markus Elfring
2017-11-24 20:52 ` [PATCH 3/4] video: udlfb: Improve a size determination in dlfb_alloc_urb_list() SF Markus Elfring
2017-11-24 20:54 ` [PATCH 4/4] video: udlfb: Delete an unnecessary return statement in two functions SF Markus Elfring
2017-12-29 18:02 ` [PATCH 0/4] video-UDLFB: Adjustments for five function implementations Bartlomiej Zolnierkiewicz
2017-12-29 18:10 ` [0/4] " SF Markus Elfring
2018-01-04 17:08 ` Bartlomiej Zolnierkiewicz
2018-01-04 17:44 ` SF Markus Elfring
2018-01-07 13:33 ` [PATCH v2 0/2] video-UDLFB: Adjustments for dlfb_realloc_framebuffer() SF Markus Elfring
2018-01-07 13:34 ` SF Markus Elfring [this message]
2018-03-28 13:42 ` [PATCH v2 1/2] video: udlfb: Return an error code only as a constant in dlfb_realloc_framebuffer Bartlomiej Zolnierkiewicz
2018-01-07 13:38 ` [PATCH v2 2/2] video: udlfb: Delete an error message for a failed memory allocation in dlfb_realloc_ SF Markus Elfring
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=632abf1e-8c40-cbd2-4bbe-5dfdf89cb95f@users.sourceforge.net \
--to=elfring@users.sourceforge.net \
--cc=b.zolnierkie@samsung.com \
--cc=bernie@plugable.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox