From patchwork Sat Sep 27 01:10:52 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Behan Webster X-Patchwork-Id: 38034 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f70.google.com (mail-wg0-f70.google.com [74.125.82.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id BA945202DB for ; Sat, 27 Sep 2014 01:11:35 +0000 (UTC) Received: by mail-wg0-f70.google.com with SMTP id b13sf287164wgh.1 for ; Fri, 26 Sep 2014 18:11:34 -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=eQz6suRQgpH8WmprVkPiR+1shoXnlbk+ApQDwYTo/8w=; b=NhGLoqyw1dsF6amTbJO7RIr+FLawu8XZdaoWEu5QNHevxZXFWhsYPxA8/9QS/4zA19 I0S5+UHPZvt44dtk9MIgCcUtz+QFvZczKAmyn1xAFieLCr2vo8+ehf9IWDZiGKggCsuQ sFQHznekFSSa3ceMHEirNv7nqbkpVHBwDjO4K29zdVH7yxvc9bD5CgVEaNs40NuRGk/R 4zwQKPq+be7gA6jCKNCPl6dfTJQg5IiusLvqQfgWK6Zdz0BwcHJTc5vWRL18bzWa6x0b ZSwcL6U2b9G6AkOXli3hr6kCklpfjIW/W5/TY0myGiI3G+/87CDPFrvM54LeprnioUSO U/Gw== X-Gm-Message-State: ALoCoQkj4t9bwzjEvOIKWwTlG+jRpKpQMltI2OE94mWS4w3yv2g+TNiFUhJc3umTbV/th5u3R9N1 X-Received: by 10.152.4.4 with SMTP id g4mr3622970lag.2.1411780294820; Fri, 26 Sep 2014 18:11:34 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.9.130 with SMTP id z2ls148755laa.61.gmail; Fri, 26 Sep 2014 18:11:34 -0700 (PDT) X-Received: by 10.152.36.4 with SMTP id m4mr23843509laj.17.1411780294641; Fri, 26 Sep 2014 18:11:34 -0700 (PDT) Received: from mail-lb0-x230.google.com (mail-lb0-x230.google.com [2a00:1450:4010:c04::230]) by mx.google.com with ESMTPS id jo5si9141454lbc.130.2014.09.26.18.11.34 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 26 Sep 2014 18:11:34 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c04::230 as permitted sender) client-ip=2a00:1450:4010:c04::230; Received: by mail-lb0-f176.google.com with SMTP id w7so10429125lbi.21 for ; Fri, 26 Sep 2014 18:11:34 -0700 (PDT) X-Received: by 10.152.42.173 with SMTP id p13mr23558144lal.23.1411780294288; Fri, 26 Sep 2014 18:11:34 -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 of9csp151085lbb; Fri, 26 Sep 2014 18:11:33 -0700 (PDT) X-Received: by 10.70.96.161 with SMTP id dt1mr45895941pdb.115.1411780292769; Fri, 26 Sep 2014 18:11:32 -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.32 for ; Fri, 26 Sep 2014 18:11:32 -0700 (PDT) Received-SPF: none (google.com: linux-fbdev-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 S1751960AbaI0BLO (ORCPT ); Fri, 26 Sep 2014 21:11:14 -0400 Received: from mail-pd0-f170.google.com ([209.85.192.170]:48159 "EHLO mail-pd0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751650AbaI0BLM (ORCPT ); Fri, 26 Sep 2014 21:11:12 -0400 Received: by mail-pd0-f170.google.com with SMTP id y13so13689889pdi.15 for ; Fri, 26 Sep 2014 18:11:12 -0700 (PDT) X-Received: by 10.66.124.202 with SMTP id mk10mr36370495pab.1.1411780272262; Fri, 26 Sep 2014 18:11:12 -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.09 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 26 Sep 2014 18:11:10 -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 1/2] arm, fbdev, omap2, LLVMLinux: Remove nested function from omap2 dss Date: Fri, 26 Sep 2014 18:10:52 -0700 Message-Id: <1411780253-4492-2-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-fbdev-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-fbdev@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:c04::230 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/dss/dispc-compat.c | 9 +++++---- drivers/video/fbdev/omap2/dss/manager-sysfs.c | 16 +++++++++------- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/drivers/video/fbdev/omap2/dss/dispc-compat.c b/drivers/video/fbdev/omap2/dss/dispc-compat.c index 83779c2..633c461 100644 --- a/drivers/video/fbdev/omap2/dss/dispc-compat.c +++ b/drivers/video/fbdev/omap2/dss/dispc-compat.c @@ -634,13 +634,14 @@ void dispc_mgr_disable_sync(enum omap_channel channel) WARN_ON(1); } +static inline void dispc_irq_wait_handler(void *data, u32 mask) +{ + complete((struct completion *)data); +} + int omap_dispc_wait_for_irq_interruptible_timeout(u32 irqmask, unsigned long timeout) { - void dispc_irq_wait_handler(void *data, u32 mask) - { - complete((struct completion *)data); - } int r; DECLARE_COMPLETION_ONSTACK(completion); diff --git a/drivers/video/fbdev/omap2/dss/manager-sysfs.c b/drivers/video/fbdev/omap2/dss/manager-sysfs.c index 37b59fe..a7414fb 100644 --- a/drivers/video/fbdev/omap2/dss/manager-sysfs.c +++ b/drivers/video/fbdev/omap2/dss/manager-sysfs.c @@ -44,6 +44,13 @@ static ssize_t manager_display_show(struct omap_overlay_manager *mgr, char *buf) dssdev->name : ""); } +static int manager_display_match(struct omap_dss_device *dssdev, void *data) +{ + const char *str = data; + + return sysfs_streq(dssdev->name, str); +} + static ssize_t manager_display_store(struct omap_overlay_manager *mgr, const char *buf, size_t size) { @@ -52,17 +59,12 @@ static ssize_t manager_display_store(struct omap_overlay_manager *mgr, struct omap_dss_device *dssdev = NULL; struct omap_dss_device *old_dssdev; - int match(struct omap_dss_device *dssdev, void *data) - { - const char *str = data; - return sysfs_streq(dssdev->name, str); - } - if (buf[size-1] == '\n') --len; if (len > 0) - dssdev = omap_dss_find_device((void *)buf, match); + dssdev = omap_dss_find_device((void *)buf, + manager_display_match); if (len > 0 && dssdev == NULL) return -EINVAL;