diff options
author | Markus Elfring <elfring@users.sourceforge.net> | 2018-03-28 16:34:27 +0200 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> | 2018-03-28 16:34:27 +0200 |
commit | 3c097b069bb82391fcad73373eccbca8400636e7 (patch) | |
tree | c1e3dea525df7bf8ce47d11ee3c1024cdc8aade3 /drivers | |
parent | b78f8ca82b5f3ee4bf6b3979624ef76fa3de7611 (diff) | |
download | linux-3c097b069bb82391fcad73373eccbca8400636e7.tar.gz linux-3c097b069bb82391fcad73373eccbca8400636e7.tar.bz2 linux-3c097b069bb82391fcad73373eccbca8400636e7.zip |
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: Markus Elfring <elfring@users.sourceforge.net>
Cc: Bernie Thompson <bernie@plugable.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/video/fbdev/udlfb.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/drivers/video/fbdev/udlfb.c b/drivers/video/fbdev/udlfb.c index 7b53fefb4b94..f365d4862015 100644 --- a/drivers/video/fbdev/udlfb.c +++ b/drivers/video/fbdev/udlfb.c @@ -1135,7 +1135,6 @@ static struct fb_ops dlfb_ops = { */ static int dlfb_realloc_framebuffer(struct dlfb_data *dlfb, struct fb_info *info) { - int retval = -ENOMEM; int old_len = info->fix.smem_len; int new_len; unsigned char *old_fb = info->screen_base; @@ -1151,7 +1150,7 @@ static int dlfb_realloc_framebuffer(struct dlfb_data *dlfb, struct fb_info *info new_fb = vmalloc(new_len); if (!new_fb) { dev_err(info->dev, "Virtual framebuffer alloc failed\n"); - goto error; + return -ENOMEM; } if (info->screen_base) { @@ -1180,11 +1179,7 @@ static int dlfb_realloc_framebuffer(struct dlfb_data *dlfb, struct fb_info *info dlfb->backing_buffer = new_back; } } - - retval = 0; - -error: - return retval; + return 0; } /* |