mirror of
https://github.com/torvalds/linux.git
synced 2024-12-15 15:41:58 +00:00
video: smscufx: Return an error code only as a constant in ufx_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: Steve Glendinning <steve.glendinning@shawell.net> Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
This commit is contained in:
parent
daa0524bc0
commit
4befd0cf21
@ -1293,7 +1293,6 @@ static struct fb_ops ufx_ops = {
|
|||||||
* Assumes no active clients have framebuffer open */
|
* Assumes no active clients have framebuffer open */
|
||||||
static int ufx_realloc_framebuffer(struct ufx_data *dev, struct fb_info *info)
|
static int ufx_realloc_framebuffer(struct ufx_data *dev, 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;
|
||||||
@ -1310,7 +1309,7 @@ static int ufx_realloc_framebuffer(struct ufx_data *dev, struct fb_info *info)
|
|||||||
new_fb = vmalloc(new_len);
|
new_fb = vmalloc(new_len);
|
||||||
if (!new_fb) {
|
if (!new_fb) {
|
||||||
pr_err("Virtual framebuffer alloc failed");
|
pr_err("Virtual framebuffer alloc failed");
|
||||||
goto error;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (info->screen_base) {
|
if (info->screen_base) {
|
||||||
@ -1323,11 +1322,7 @@ static int ufx_realloc_framebuffer(struct ufx_data *dev, struct fb_info *info)
|
|||||||
info->fix.smem_start = (unsigned long) new_fb;
|
info->fix.smem_start = (unsigned long) new_fb;
|
||||||
info->flags = smscufx_info_flags;
|
info->flags = smscufx_info_flags;
|
||||||
}
|
}
|
||||||
|
return 0;
|
||||||
retval = 0;
|
|
||||||
|
|
||||||
error:
|
|
||||||
return retval;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* sets up I2C Controller for 100 Kbps, std. speed, 7-bit addr, master,
|
/* sets up I2C Controller for 100 Kbps, std. speed, 7-bit addr, master,
|
||||||
|
Loading…
Reference in New Issue
Block a user