Skip to content

Commit

Permalink
staging: sm750fb: rearrange code
Browse files Browse the repository at this point in the history
Rearrange the code to remove one exit label which also makes the code
less indented and more readable.

Signed-off-by: Sudip Mukherjee <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
sudipm-mukherjee authored and gregkh committed Aug 7, 2015
1 parent d11ac7c commit f8fbc83
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions drivers/staging/sm750fb/sm750.c
Original file line number Diff line number Diff line change
Expand Up @@ -261,22 +261,21 @@ static void lynxfb_ops_imageblit(struct fb_info *info,
pitch = info->fix.line_length;
Bpp = info->var.bits_per_pixel >> 3;

if (image->depth == 1) {
if (info->fix.visual == FB_VISUAL_TRUECOLOR ||
info->fix.visual == FB_VISUAL_DIRECTCOLOR) {
fgcol = ((u32 *)info->pseudo_palette)[image->fg_color];
bgcol = ((u32 *)info->pseudo_palette)[image->bg_color];
} else {
fgcol = image->fg_color;
bgcol = image->bg_color;
}
goto _do_work;
}
/* TODO: Implement hardware acceleration for image->depth > 1 */
cfb_imageblit(info, image);
return;
if (image->depth != 1) {
cfb_imageblit(info, image);
return;
}

if (info->fix.visual == FB_VISUAL_TRUECOLOR ||
info->fix.visual == FB_VISUAL_DIRECTCOLOR) {
fgcol = ((u32 *)info->pseudo_palette)[image->fg_color];
bgcol = ((u32 *)info->pseudo_palette)[image->bg_color];
} else {
fgcol = image->fg_color;
bgcol = image->bg_color;
}

_do_work:
/*
* If not use spin_lock, system will die if user load driver
* and immediately unload driver frequently (dual)
Expand Down

0 comments on commit f8fbc83

Please sign in to comment.