Skip to content

Commit

Permalink
omap: iommu: PREFETCH_IOTLB cleanup
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ohad Ben-Cohen authored and Joerg Roedel committed Aug 26, 2011
1 parent e1f2381 commit 5da14a4
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions drivers/iommu/omap-iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -310,6 +311,20 @@ static int load_iotlb_entry(struct iommu *obj, struct iotlb_entry *e)
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
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 5da14a4

Please sign in to comment.