From patchwork Sat Sep 27 01:11:45 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Behan Webster X-Patchwork-Id: 38036 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f71.google.com (mail-wg0-f71.google.com [74.125.82.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 3C07C202DB for ; Sat, 27 Sep 2014 01:12:04 +0000 (UTC) Received: by mail-wg0-f71.google.com with SMTP id y10sf6427933wgg.6 for ; Fri, 26 Sep 2014 18:12:03 -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:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=dzuIcTLDT5KAd83vUorL13Fmvd2v1+rR6Lm7DeQw89I=; b=dCSniPkeR9xcZ5T4BX/P6cLxkElSHO10cTQvRRobZm5ZLNtHpinwWgogw0u98LSQbo UNgNuoYT/aumfgF1OLlhgYtk98N9R9Odht1z/naKo1xI1qJey8RC6JLkuij0x5ZGZdRU Fh7ugb9C0B/3kIxBN8xu2fwAZUu8oaXRFYJAhTkZyMnbxuYZFZGSxy+/A6ymRSLW4xo4 ttwEMDligRH5hB7ZsApLm+JSsWy2MNfHfM3yeGWs4oLfnlOph+Ybz0QJHLycDnWtKg6F VMB8V/fSQMs+ml2u/GakOwyv6+eNWlzduumUhlTz2gcZ8bdoj7rqYyZFafJiA7xsC1pJ K3BQ== X-Gm-Message-State: ALoCoQkr5V9CHa86WqiNuDuNgPhpdrGUn6OsTNLRLhRlnecV620XZ6k3BtwFRJdWrzZeTluUkPLh X-Received: by 10.112.190.102 with SMTP id gp6mr4283lbc.10.1411780323372; Fri, 26 Sep 2014 18:12:03 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.23.227 with SMTP id p3ls226136laf.39.gmail; Fri, 26 Sep 2014 18:12:03 -0700 (PDT) X-Received: by 10.112.170.165 with SMTP id an5mr13963217lbc.6.1411780323197; Fri, 26 Sep 2014 18:12:03 -0700 (PDT) Received: from mail-lb0-x236.google.com (mail-lb0-x236.google.com [2a00:1450:4010:c04::236]) by mx.google.com with ESMTPS id y9si9336866lbr.1.2014.09.26.18.12.03 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 26 Sep 2014 18:12:03 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c04::236 as permitted sender) client-ip=2a00:1450:4010:c04::236; Received: by mail-lb0-f182.google.com with SMTP id z11so3707773lbi.27 for ; Fri, 26 Sep 2014 18:12:03 -0700 (PDT) X-Received: by 10.152.22.137 with SMTP id d9mr23962885laf.29.1411780323125; Fri, 26 Sep 2014 18:12:03 -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 of9csp151121lbb; Fri, 26 Sep 2014 18:12:02 -0700 (PDT) X-Received: by 10.68.183.35 with SMTP id ej3mr12786186pbc.54.1411780321734; Fri, 26 Sep 2014 18:12:01 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id cc5si4737975pad.156.2014.09.26.18.12.00 for ; Fri, 26 Sep 2014 18:12:01 -0700 (PDT) Received-SPF: none (google.com: linux-media-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 S1752472AbaI0BL6 (ORCPT + 2 others); Fri, 26 Sep 2014 21:11:58 -0400 Received: from mail-pa0-f46.google.com ([209.85.220.46]:36726 "EHLO mail-pa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752418AbaI0BL5 (ORCPT ); Fri, 26 Sep 2014 21:11:57 -0400 Received: by mail-pa0-f46.google.com with SMTP id kq14so954359pab.5 for ; Fri, 26 Sep 2014 18:11:57 -0700 (PDT) X-Received: by 10.70.10.100 with SMTP id h4mr419436pdb.162.1411780317432; Fri, 26 Sep 2014 18:11:57 -0700 (PDT) Received: from galdor.websterwood.com (S0106dc9fdb80cffd.gv.shawcable.net. [96.50.97.138]) by mx.google.com with ESMTPSA id pp2sm5988539pbc.66.2014.09.26.18.11.54 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 26 Sep 2014 18:11:56 -0700 (PDT) From: Behan Webster To: archit@ti.com, b.zolnierkie@samsung.com, m.chehab@samsung.com Cc: behanw@converseincode.com, hans.verkuil@cisco.com, k.debski@samsung.com, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, Arnd Bergmann Subject: [PATCH] media, platform, LLVMLinux: Remove nested function from ti-vpe Date: Fri, 26 Sep 2014 18:11:45 -0700 Message-Id: <1411780305-5685-1-git-send-email-behanw@converseincode.com> X-Mailer: git-send-email 1.9.1 Sender: linux-media-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-media@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::236 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 --- drivers/media/platform/ti-vpe/csc.c | 8 ++------ drivers/media/platform/ti-vpe/sc.c | 8 ++------ 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/drivers/media/platform/ti-vpe/csc.c b/drivers/media/platform/ti-vpe/csc.c index 940df40..44fbf41 100644 --- a/drivers/media/platform/ti-vpe/csc.c +++ b/drivers/media/platform/ti-vpe/csc.c @@ -93,12 +93,8 @@ void csc_dump_regs(struct csc_data *csc) { struct device *dev = &csc->pdev->dev; - u32 read_reg(struct csc_data *csc, int offset) - { - return ioread32(csc->base + offset); - } - -#define DUMPREG(r) dev_dbg(dev, "%-35s %08x\n", #r, read_reg(csc, CSC_##r)) +#define DUMPREG(r) dev_dbg(dev, "%-35s %08x\n", #r, \ + ioread32(csc->base + CSC_##r)) DUMPREG(CSC00); DUMPREG(CSC01); diff --git a/drivers/media/platform/ti-vpe/sc.c b/drivers/media/platform/ti-vpe/sc.c index 6314171..1088381 100644 --- a/drivers/media/platform/ti-vpe/sc.c +++ b/drivers/media/platform/ti-vpe/sc.c @@ -24,12 +24,8 @@ void sc_dump_regs(struct sc_data *sc) { struct device *dev = &sc->pdev->dev; - u32 read_reg(struct sc_data *sc, int offset) - { - return ioread32(sc->base + offset); - } - -#define DUMPREG(r) dev_dbg(dev, "%-35s %08x\n", #r, read_reg(sc, CFG_##r)) +#define DUMPREG(r) dev_dbg(dev, "%-35s %08x\n", #r, \ + ioread32(sc->base + CFG_##r)) DUMPREG(SC0); DUMPREG(SC1);