From patchwork Wed Aug 17 23:10:05 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ohad Ben Cohen X-Patchwork-Id: 1075252 Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p7HNEDIS020455 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 17 Aug 2011 23:14:34 GMT Received: from canuck.infradead.org ([2001:4978:20e::1]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QtpIp-0005gw-8i; Wed, 17 Aug 2011 23:13:41 +0000 Received: from localhost ([127.0.0.1] helo=canuck.infradead.org) by canuck.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1QtpH3-0000Vc-SF; Wed, 17 Aug 2011 23:11:49 +0000 Received: from mail-ww0-f49.google.com ([74.125.82.49]) by canuck.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QtpG2-0000HD-Om for linux-arm-kernel@lists.infradead.org; Wed, 17 Aug 2011 23:10:50 +0000 Received: by mail-ww0-f49.google.com with SMTP id 10so1084397wwf.18 for ; Wed, 17 Aug 2011 16:10:46 -0700 (PDT) Received: by 10.216.59.130 with SMTP id s2mr4695077wec.26.1313622646376; Wed, 17 Aug 2011 16:10:46 -0700 (PDT) Received: from localhost.localdomain (93-172-45-253.bb.netvision.net.il [93.172.45.253]) by mx.google.com with ESMTPS id el9sm1292103wbb.24.2011.08.17.16.10.44 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 17 Aug 2011 16:10:46 -0700 (PDT) From: Ohad Ben-Cohen To: Subject: [PATCH 4/7] omap: iommu: PREFETCH_IOTLB cleanup Date: Thu, 18 Aug 2011 02:10:05 +0300 Message-Id: <1313622608-30397-5-git-send-email-ohad@wizery.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1313622608-30397-1-git-send-email-ohad@wizery.com> References: <1313622608-30397-1-git-send-email-ohad@wizery.com> X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20110817_191046_925544_39C5E9B6 X-CRM114-Status: GOOD ( 13.55 ) X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.3.1 on canuck.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [74.125.82.49 listed in list.dnswl.org] Cc: Ohad Ben-Cohen , Arnd Bergmann , Tony Lindgren , Joerg Roedel , Hiroshi DOYU , iommu@lists.linux-foundation.org, Laurent Pinchart , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Wed, 17 Aug 2011 23:14:34 +0000 (UTC) Use PREFETCH_IOTLB to control the content of the called function, instead of inlining it in the code. This improves readability of the code, and also prevents an "unused function" warning to show up when PREFETCH_IOTLB isn't set. While we're at it, rename load_iotlb_entry to prefetch_iotlb_entry to better reflect the purpose of that function. Signed-off-by: Ohad Ben-Cohen --- drivers/iommu/omap-iommu.c | 18 +++++++++++++----- 1 files changed, 13 insertions(+), 5 deletions(-) diff --git a/drivers/iommu/omap-iommu.c b/drivers/iommu/omap-iommu.c index ed81977..7280e5b 100644 --- a/drivers/iommu/omap-iommu.c +++ b/drivers/iommu/omap-iommu.c @@ -248,11 +248,12 @@ static struct cr_regs __iotlb_read_cr(struct iommu *obj, int n) } /** - * load_iotlb_entry - Set an iommu tlb entry + * prefetch_iotlb_entry - Set an iommu tlb entry * @obj: target iommu * @e: an iommu tlb entry info **/ -static int load_iotlb_entry(struct iommu *obj, struct iotlb_entry *e) +#ifdef PREFETCH_IOTLB +static int prefetch_iotlb_entry(struct iommu *obj, struct iotlb_entry *e) { int err = 0; struct iotlb_lock l; @@ -309,6 +310,15 @@ out: return err; } +#else /* !PREFETCH_IOTLB */ + +static int prefetch_iotlb_entry(struct iommu *obj, struct iotlb_entry *e) +{ + return 0; +} + +#endif /* !PREFETCH_IOTLB */ + /** * flush_iotlb_page - Clear an iommu tlb entry * @obj: target iommu @@ -662,10 +672,8 @@ int iopgtable_store_entry(struct iommu *obj, struct iotlb_entry *e) flush_iotlb_page(obj, e->da); err = iopgtable_store_entry_core(obj, e); -#ifdef PREFETCH_IOTLB if (!err) - load_iotlb_entry(obj, e); -#endif + prefetch_iotlb_entry(obj, e); return err; } EXPORT_SYMBOL_GPL(iopgtable_store_entry);