diff options
author | Sudip Mukherjee <sudipm.mukherjee@gmail.com> | 2015-08-07 15:04:05 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-08-08 01:12:54 +0300 |
commit | f8fbc838f4b2cd72da11568b09b956806b98c29e (patch) | |
tree | 93d081acad6b199836b63510a9e9bb3f0ed15cd6 /drivers/staging/sm750fb/sm750.c | |
parent | d11ac7cbcc266c6c2a6ae504e070b6dc4536c1f7 (diff) | |
download | linux-f8fbc838f4b2cd72da11568b09b956806b98c29e.tar.xz |
staging: sm750fb: rearrange code
Rearrange the code to remove one exit label which also makes the code
less indented and more readable.
Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/sm750fb/sm750.c')
-rw-r--r-- | drivers/staging/sm750fb/sm750.c | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c index fa2183d33bda..e7fad0f2cdf8 100644 --- a/drivers/staging/sm750fb/sm750.c +++ b/drivers/staging/sm750fb/sm750.c @@ -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) |