Skip to content

Commit af199e6

Browse files
ShivaprasadGBhatmpe
authored andcommitted
powerpc/pseries/iommu: Define spapr_tce_table_group_ops only with CONFIG_IOMMU_API
The patch fixes the below warning: arch/powerpc/platforms/pseries/iommu.c:1824:37: warning: 'spapr_tce_table_group_ops' defined but not used Reported-by: kernel test robot <[email protected]> Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/ Fixes: b09c031 ("powerpc/iommu: Move pSeries specific functions to pseries/iommu.c") Signed-off-by: Shivaprasad G Bhat <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://msgid.link/[email protected]
1 parent 17c743b commit af199e6

File tree

1 file changed

+8
-0
lines changed
  • arch/powerpc/platforms/pseries

1 file changed

+8
-0
lines changed

arch/powerpc/platforms/pseries/iommu.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,9 @@ static struct iommu_table *iommu_pseries_alloc_table(int node)
6868
return tbl;
6969
}
7070

71+
#ifdef CONFIG_IOMMU_API
7172
static struct iommu_table_group_ops spapr_tce_table_group_ops;
73+
#endif
7274

7375
static struct iommu_table_group *iommu_pseries_alloc_group(int node)
7476
{
@@ -165,6 +167,7 @@ static unsigned long tce_get_pseries(struct iommu_table *tbl, long index)
165167
return be64_to_cpu(*tcep);
166168
}
167169

170+
#ifdef CONFIG_IOMMU_API
168171
static long pseries_tce_iommu_userspace_view_alloc(struct iommu_table *tbl)
169172
{
170173
unsigned long cb = ALIGN(sizeof(tbl->it_userspace[0]) * tbl->it_size, PAGE_SIZE);
@@ -183,6 +186,7 @@ static long pseries_tce_iommu_userspace_view_alloc(struct iommu_table *tbl)
183186

184187
return 0;
185188
}
189+
#endif
186190

187191
static void tce_iommu_userspace_view_free(struct iommu_table *tbl)
188192
{
@@ -738,6 +742,7 @@ struct iommu_table_ops iommu_table_lpar_multi_ops = {
738742
.free = tce_free_pSeries
739743
};
740744

745+
#ifdef CONFIG_IOMMU_API
741746
/*
742747
* When the DMA window properties might have been removed,
743748
* the parent node has the table_group setup on it.
@@ -757,6 +762,7 @@ static struct device_node *pci_dma_find_parent_node(struct pci_dev *dev,
757762

758763
return NULL;
759764
}
765+
#endif
760766

761767
/*
762768
* Find nearest ibm,dma-window (default DMA window) or direct DMA window or
@@ -1845,6 +1851,7 @@ static bool iommu_bypass_supported_pSeriesLP(struct pci_dev *pdev, u64 dma_mask)
18451851
return false;
18461852
}
18471853

1854+
#ifdef CONFIG_IOMMU_API
18481855
/*
18491856
* A simple iommu_table_group_ops which only allows reusing the existing
18501857
* iommu_table. This handles VFIO for POWER7 or the nested KVM.
@@ -2327,6 +2334,7 @@ static struct iommu_table_group_ops spapr_tce_table_group_ops = {
23272334
.take_ownership = spapr_tce_take_ownership,
23282335
.release_ownership = spapr_tce_release_ownership,
23292336
};
2337+
#endif
23302338

23312339
static int iommu_mem_notifier(struct notifier_block *nb, unsigned long action,
23322340
void *data)

0 commit comments

Comments
 (0)