From patchwork Wed Aug 24 17:08:11 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: 1093252 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p7OH9I6B014179 for ; Wed, 24 Aug 2011 17:09:19 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752766Ab1HXRJL (ORCPT ); Wed, 24 Aug 2011 13:09:11 -0400 Received: from mail-ww0-f44.google.com ([74.125.82.44]:54580 "EHLO mail-ww0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752725Ab1HXRJI (ORCPT ); Wed, 24 Aug 2011 13:09:08 -0400 Received: by mail-ww0-f44.google.com with SMTP id 5so1445872wwf.1 for ; Wed, 24 Aug 2011 10:09:07 -0700 (PDT) Received: by 10.216.178.203 with SMTP id f53mr676391wem.0.1314205747534; Wed, 24 Aug 2011 10:09:07 -0700 (PDT) Received: from localhost.localdomain (93-173-14-64.bb.netvision.net.il [93.173.14.64]) by mx.google.com with ESMTPS id 11sm992031wbw.60.2011.08.24.10.09.05 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 24 Aug 2011 10:09:07 -0700 (PDT) From: Ohad Ben-Cohen To: Cc: , Tony Lindgren , Hiroshi DOYU , Laurent Pinchart , Joerg Roedel , Arnd Bergmann , , Ohad Ben-Cohen Subject: [PATCH v2 4/7] omap: iommu: PREFETCH_IOTLB cleanup Date: Wed, 24 Aug 2011 20:08:11 +0300 Message-Id: <1314205694-28935-5-git-send-email-ohad@wizery.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1314205694-28935-1-git-send-email-ohad@wizery.com> References: <1314205694-28935-1-git-send-email-ohad@wizery.com> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.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, 24 Aug 2011 17:09:19 +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. Signed-off-by: Ohad Ben-Cohen Acked-by: Hiroshi DOYU --- drivers/iommu/omap-iommu.c | 19 ++++++++++++++++--- 1 files changed, 16 insertions(+), 3 deletions(-) diff --git a/drivers/iommu/omap-iommu.c b/drivers/iommu/omap-iommu.c index 3aad2e3..966093a 100644 --- a/drivers/iommu/omap-iommu.c +++ b/drivers/iommu/omap-iommu.c @@ -253,6 +253,7 @@ static struct cr_regs __iotlb_read_cr(struct iommu *obj, int n) * @obj: target iommu * @e: an iommu tlb entry info **/ +#ifdef PREFETCH_IOTLB static int load_iotlb_entry(struct iommu *obj, struct iotlb_entry *e) { int err = 0; @@ -310,6 +311,20 @@ out: return err; } +#else /* !PREFETCH_IOTLB */ + +static int load_iotlb_entry(struct iommu *obj, struct iotlb_entry *e) +{ + return 0; +} + +#endif /* !PREFETCH_IOTLB */ + +static int prefetch_iotlb_entry(struct iommu *obj, struct iotlb_entry *e) +{ + return load_iotlb_entry(obj, e); +} + /** * flush_iotlb_page - Clear an iommu tlb entry * @obj: target iommu @@ -663,10 +678,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);