From: ohad@wizery.com (Ohad Ben-Cohen)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 4/7] omap: iommu: PREFETCH_IOTLB cleanup
Date: Wed, 24 Aug 2011 20:08:11 +0300 [thread overview]
Message-ID: <1314205694-28935-5-git-send-email-ohad@wizery.com> (raw)
In-Reply-To: <1314205694-28935-1-git-send-email-ohad@wizery.com>
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 <ohad@wizery.com>
Acked-by: Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
---
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);
--
1.7.4.1
next prev parent reply other threads:[~2011-08-24 17:08 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-24 17:08 [PATCH v2 0/7] omap: iommu migration, relocation and cleanups Ohad Ben-Cohen
2011-08-24 17:08 ` [PATCH v2 1/7] omap: iommu: migrate to the generic IOMMU API Ohad Ben-Cohen
2011-08-24 17:08 ` [PATCH v2 2/7] omap: iommu/iovmm: move to dedicated iommu folder Ohad Ben-Cohen
2011-08-24 17:08 ` [PATCH v2 3/7] omap: iommu: stop exporting local functions Ohad Ben-Cohen
2011-08-24 17:08 ` Ohad Ben-Cohen [this message]
2011-08-24 17:08 ` [PATCH v2 5/7] omap: iovmm: remove unused functionality Ohad Ben-Cohen
2011-08-24 17:08 ` [PATCH v2 6/7] omap: iommu: remove unused exported API Ohad Ben-Cohen
2011-08-24 17:08 ` [PATCH v2 7/7] omap: iommu: omapify 'struct iommu' and exposed API Ohad Ben-Cohen
2011-08-25 16:03 ` [PATCH v2 0/7] omap: iommu migration, relocation and cleanups Tony Lindgren
2011-08-26 11:25 ` Roedel, Joerg
2011-08-26 12:21 ` Ohad Ben-Cohen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1314205694-28935-5-git-send-email-ohad@wizery.com \
--to=ohad@wizery.com \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).