From patchwork Fri Aug 7 12:04:05 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudip Mukherjee X-Patchwork-Id: 6968641 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id F05D69F38B for ; Fri, 7 Aug 2015 12:05:38 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 22C6020628 for ; Fri, 7 Aug 2015 12:05:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 379AF2062D for ; Fri, 7 Aug 2015 12:05:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752960AbbHGMFN (ORCPT ); Fri, 7 Aug 2015 08:05:13 -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 Received: by pabyb7 with SMTP id yb7so54697576pab.0; Fri, 07 Aug 2015 05:04:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=GQI9YfsL0B9rYdWiChXxxpSYA6Wx1EZRRfBQB2ZIoBI=; b=fpJ5VLrCkv0j7yidUne18PQBNcsffsPGahqyoAutP8isTLR4eYQethR1OHy/b+5Ylb vneANgkLBgMtgurrbJlkiqnb82L3mOVUgSekvGg+UfUlG4Hv1EnXjM+UwbZjoqFEE7XJ /7YOL9Oy0d+0qiAGpM4Q8l6Y9CZ7j8//AofnpeTQP5O5QRnZ8M6/CaUceKMkQR7n6Eef WVWtP/SH6rHHB7TtGwFDZo7irWBVwZ7/pRMkB47X+pqM1X5xH6/7l5To2ttyuFpitiOb YjG7R+ts5/BNj22I1ml8Bj+SMnU38G0CH3GdDimKVGtqSuJyUelPzTZ6/1pK0LD/Nm3K tgxg== X-Received: by 10.66.185.72 with SMTP id fa8mr14088117pac.44.1438949064767; Fri, 07 Aug 2015 05:04:24 -0700 (PDT) Received: from localhost.localdomain ([49.206.246.113]) by smtp.gmail.com with ESMTPSA id rp12sm5745689pbb.65.2015.08.07.05.04.22 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 07 Aug 2015 05:04:24 -0700 (PDT) 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-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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)