Commit 3c097b06 authored by Markus Elfring's avatar Markus Elfring Committed by Bartlomiej Zolnierkiewicz

video: udlfb: Return an error code only as a constant in dlfb_realloc_framebuffer()

* 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: default avatarMarkus Elfring <elfring@users.sourceforge.net>
Cc: Bernie Thompson <bernie@plugable.com>
Signed-off-by: default avatarBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
parent b78f8ca8
...@@ -1135,7 +1135,6 @@ static struct fb_ops dlfb_ops = { ...@@ -1135,7 +1135,6 @@ static struct fb_ops dlfb_ops = {
*/ */
static int dlfb_realloc_framebuffer(struct dlfb_data *dlfb, struct fb_info *info) static int dlfb_realloc_framebuffer(struct dlfb_data *dlfb, struct fb_info *info)
{ {
int retval = -ENOMEM;
int old_len = info->fix.smem_len; int old_len = info->fix.smem_len;
int new_len; int new_len;
unsigned char *old_fb = info->screen_base; unsigned char *old_fb = info->screen_base;
...@@ -1151,7 +1150,7 @@ static int dlfb_realloc_framebuffer(struct dlfb_data *dlfb, struct fb_info *info ...@@ -1151,7 +1150,7 @@ static int dlfb_realloc_framebuffer(struct dlfb_data *dlfb, struct fb_info *info
new_fb = vmalloc(new_len); new_fb = vmalloc(new_len);
if (!new_fb) { if (!new_fb) {
dev_err(info->dev, "Virtual framebuffer alloc failed\n"); dev_err(info->dev, "Virtual framebuffer alloc failed\n");
goto error; return -ENOMEM;
} }
if (info->screen_base) { if (info->screen_base) {
...@@ -1180,11 +1179,7 @@ static int dlfb_realloc_framebuffer(struct dlfb_data *dlfb, struct fb_info *info ...@@ -1180,11 +1179,7 @@ static int dlfb_realloc_framebuffer(struct dlfb_data *dlfb, struct fb_info *info
dlfb->backing_buffer = new_back; dlfb->backing_buffer = new_back;
} }
} }
return 0;
retval = 0;
error:
return retval;
} }
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment