From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753433AbbHGMFO (ORCPT ); Fri, 7 Aug 2015 08:05:14 -0400 Received: from mail-pa0-f52.google.com ([209.85.220.52]:33665 "EHLO mail-pa0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752589AbbHGMEZ (ORCPT ); Fri, 7 Aug 2015 08:04:25 -0400 From: Sudip Mukherjee To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, devel@driverdev.osuosl.org, linux-fbdev@vger.kernel.org, Sudip Mukherjee Subject: [PATCH 4/5] staging: sm750fb: rearrange code Date: Fri, 7 Aug 2015 17:34:05 +0530 Message-Id: <1438949046-18765-4-git-send-email-sudipm.mukherjee@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1438949046-18765-1-git-send-email-sudipm.mukherjee@gmail.com> References: <1438949046-18765-1-git-send-email-sudipm.mukherjee@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Rearrange the code to remove one exit label which also makes the code less indented and more readable. Signed-off-by: Sudip Mukherjee --- drivers/staging/sm750fb/sm750.c | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c index fa2183d..e7fad0f 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) -- 1.9.1