From patchwork Sat Sep 27 01:10:53 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Behan Webster X-Patchwork-Id: 38035 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-we0-f200.google.com (mail-we0-f200.google.com [74.125.82.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 125EF202DB for ; Sat, 27 Sep 2014 01:11:37 +0000 (UTC) Received: by mail-we0-f200.google.com with SMTP id w62sf5537620wes.7 for ; Fri, 26 Sep 2014 18:11:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=VVtdY0pQGI6tSkQ5zBTtIeLuYmCJn+XbdULMPNyNlF0=; b=LRkAk+BzHWN+6Z6QpBMoG/brFYRRQoAmJtPxYvlN9DcacvTL7m3YhbEZhQvzNTbei9 LfZEwM5fomkP/m5bOMEBmo2mRaLqZcrzIe95C8PpKbBZg2qXWcq2Tw2UWglJHkaMMHks e14DtWUipRE+D2YflK5sqHAW4FOx7nnGbeCixFcihqYqzy1Lvyb9U2t6Wzv+ejUxGylP QORGzV3wG55Xv/nLCUpqTccxpnymAdtTMMwWAtV3j42h9M0nq0Evx2aR/Yud3AbcNPf8 1Wxvxcje7YmRs+qSsPUs+ZCaXTYtZ1D3VITNoa4e4MKzEXIOEjoWXtH53iTMTlkbdOn4 O9gw== X-Gm-Message-State: ALoCoQkFbRf2N4A1i7x2MY+XoH6+gI+XE97qbsad4gN9zkV78WapNwEO+hH9yRNHYeBMQAzfj4sZ X-Received: by 10.112.184.197 with SMTP id ew5mr3623294lbc.0.1411780297245; Fri, 26 Sep 2014 18:11:37 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.30.40 with SMTP id p8ls376388lah.106.gmail; Fri, 26 Sep 2014 18:11:37 -0700 (PDT) X-Received: by 10.112.44.129 with SMTP id e1mr22790319lbm.78.1411780297015; Fri, 26 Sep 2014 18:11:37 -0700 (PDT) Received: from mail-la0-x22b.google.com (mail-la0-x22b.google.com [2a00:1450:4010:c03::22b]) by mx.google.com with ESMTPS id 1si9201856lal.89.2014.09.26.18.11.36 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 26 Sep 2014 18:11:36 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c03::22b as permitted sender) client-ip=2a00:1450:4010:c03::22b; Received: by mail-la0-f43.google.com with SMTP id gb8so5811414lab.2 for ; Fri, 26 Sep 2014 18:11:36 -0700 (PDT) X-Received: by 10.112.130.168 with SMTP id of8mr23085038lbb.5.1411780296904; Fri, 26 Sep 2014 18:11:36 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.130.169 with SMTP id of9csp151093lbb; Fri, 26 Sep 2014 18:11:36 -0700 (PDT) X-Received: by 10.66.250.227 with SMTP id zf3mr36115498pac.135.1411780294860; Fri, 26 Sep 2014 18:11:34 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m5si11661792pde.232.2014.09.26.18.11.34 for ; Fri, 26 Sep 2014 18:11:34 -0700 (PDT) Received-SPF: none (google.com: linux-omap-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752135AbaI0BLa (ORCPT + 5 others); Fri, 26 Sep 2014 21:11:30 -0400 Received: from mail-pd0-f179.google.com ([209.85.192.179]:39850 "EHLO mail-pd0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751932AbaI0BLO (ORCPT ); Fri, 26 Sep 2014 21:11:14 -0400 Received: by mail-pd0-f179.google.com with SMTP id ft15so13965643pdb.10 for ; Fri, 26 Sep 2014 18:11:14 -0700 (PDT) X-Received: by 10.68.219.104 with SMTP id pn8mr36796307pbc.152.1411780274175; Fri, 26 Sep 2014 18:11:14 -0700 (PDT) Received: from galdor.websterwood.com (S0106dc9fdb80cffd.gv.shawcable.net. [96.50.97.138]) by mx.google.com with ESMTPSA id gu10sm5983401pbc.72.2014.09.26.18.11.12 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 26 Sep 2014 18:11:13 -0700 (PDT) From: Behan Webster To: plagnioj@jcrosoft.com, tomi.valkeinen@ti.com Cc: behanw@converseincode.com, archit@ti.com, daniel.vetter@ffwll.ch, geert@linux-m68k.org, laurent.pinchart@ideasonboard.com, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org, robdclark@gmail.com, Arnd Bergmann Subject: [PATCH 2/2] arm, fbdev, omap2, LLVMLinux: Remove nested function from omapfb Date: Fri, 26 Sep 2014 18:10:53 -0700 Message-Id: <1411780253-4492-3-git-send-email-behanw@converseincode.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1411780253-4492-1-git-send-email-behanw@converseincode.com> References: <1411780253-4492-1-git-send-email-behanw@converseincode.com> Sender: linux-omap-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Original-Sender: behanw@converseincode.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c03::22b as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org; dkim=neutral (body hash did not verify) header.i=@ Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Replace the use of nested functions where a normal function will suffice. Nested functions are not liked by upstream kernel developers in general. Their use breaks the use of clang as a compiler, and doesn't make the code any better. This code now works for both gcc and clang. Signed-off-by: Behan Webster Suggested-by: Arnd Bergmann Cc: Arnd Bergmann Reviewed-by: Felipe Balbi --- drivers/video/fbdev/omap2/omapfb/omapfb-main.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/video/fbdev/omap2/omapfb/omapfb-main.c b/drivers/video/fbdev/omap2/omapfb/omapfb-main.c index ec2d132..1587243 100644 --- a/drivers/video/fbdev/omap2/omapfb/omapfb-main.c +++ b/drivers/video/fbdev/omap2/omapfb/omapfb-main.c @@ -273,16 +273,16 @@ static struct omapfb_colormode omapfb_colormodes[] = { }, }; +static bool cmp_component(struct fb_bitfield *f1, struct fb_bitfield *f2) +{ + return f1->length == f2->length && + f1->offset == f2->offset && + f1->msb_right == f2->msb_right; +} + static bool cmp_var_to_colormode(struct fb_var_screeninfo *var, struct omapfb_colormode *color) { - bool cmp_component(struct fb_bitfield *f1, struct fb_bitfield *f2) - { - return f1->length == f2->length && - f1->offset == f2->offset && - f1->msb_right == f2->msb_right; - } - if (var->bits_per_pixel == 0 || var->red.length == 0 || var->blue.length == 0 ||