diff options
author | Ohad Ben-Cohen <ohad@wizery.com> | 2011-08-16 08:19:10 -0400 |
---|---|---|
committer | Joerg Roedel <joerg.roedel@amd.com> | 2011-08-26 05:46:00 -0400 |
commit | 5da14a471455bd725534d18604b4d89ffbe158df (patch) | |
tree | 32265ab3d038268d55709394855726487fce5d17 /drivers/iommu/omap-iommu.c | |
parent | e1f2381332825f04b9816f354fdd48f17dc6193d (diff) |
omap: iommu: PREFETCH_IOTLB cleanup
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>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Diffstat (limited to 'drivers/iommu/omap-iommu.c')
-rw-r--r-- | 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 3aad2e34cbab..966093a2fcf5 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) | |||
253 | * @obj: target iommu | 253 | * @obj: target iommu |
254 | * @e: an iommu tlb entry info | 254 | * @e: an iommu tlb entry info |
255 | **/ | 255 | **/ |
256 | #ifdef PREFETCH_IOTLB | ||
256 | static int load_iotlb_entry(struct iommu *obj, struct iotlb_entry *e) | 257 | static int load_iotlb_entry(struct iommu *obj, struct iotlb_entry *e) |
257 | { | 258 | { |
258 | int err = 0; | 259 | int err = 0; |
@@ -310,6 +311,20 @@ out: | |||
310 | return err; | 311 | return err; |
311 | } | 312 | } |
312 | 313 | ||
314 | #else /* !PREFETCH_IOTLB */ | ||
315 | |||
316 | static int load_iotlb_entry(struct iommu *obj, struct iotlb_entry *e) | ||
317 | { | ||
318 | return 0; | ||
319 | } | ||
320 | |||
321 | #endif /* !PREFETCH_IOTLB */ | ||
322 | |||
323 | static int prefetch_iotlb_entry(struct iommu *obj, struct iotlb_entry *e) | ||
324 | { | ||
325 | return load_iotlb_entry(obj, e); | ||
326 | } | ||
327 | |||
313 | /** | 328 | /** |
314 | * flush_iotlb_page - Clear an iommu tlb entry | 329 | * flush_iotlb_page - Clear an iommu tlb entry |
315 | * @obj: target iommu | 330 | * @obj: target iommu |
@@ -663,10 +678,8 @@ int iopgtable_store_entry(struct iommu *obj, struct iotlb_entry *e) | |||
663 | 678 | ||
664 | flush_iotlb_page(obj, e->da); | 679 | flush_iotlb_page(obj, e->da); |
665 | err = iopgtable_store_entry_core(obj, e); | 680 | err = iopgtable_store_entry_core(obj, e); |
666 | #ifdef PREFETCH_IOTLB | ||
667 | if (!err) | 681 | if (!err) |
668 | load_iotlb_entry(obj, e); | 682 | prefetch_iotlb_entry(obj, e); |
669 | #endif | ||
670 | return err; | 683 | return err; |
671 | } | 684 | } |
672 | EXPORT_SYMBOL_GPL(iopgtable_store_entry); | 685 | EXPORT_SYMBOL_GPL(iopgtable_store_entry); |