Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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 <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202407020357.Hz8kQkKf-lkp@intel.com/
Fixes: b09c031d9433 ("powerpc/iommu: Move pSeries specific functions to pseries/iommu.c")
Signed-off-by: Shivaprasad G Bhat <sbhat@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/172008854222.784.13666247605789409729.stgit@linux.ibm.com

authored by

Shivaprasad G Bhat and committed by
Michael Ellerman
af199e6c 17c743b9

+8
+8
arch/powerpc/platforms/pseries/iommu.c
··· 68 68 return tbl; 69 69 } 70 70 71 + #ifdef CONFIG_IOMMU_API 71 72 static struct iommu_table_group_ops spapr_tce_table_group_ops; 73 + #endif 72 74 73 75 static struct iommu_table_group *iommu_pseries_alloc_group(int node) 74 76 { ··· 167 165 return be64_to_cpu(*tcep); 168 166 } 169 167 168 + #ifdef CONFIG_IOMMU_API 170 169 static long pseries_tce_iommu_userspace_view_alloc(struct iommu_table *tbl) 171 170 { 172 171 unsigned long cb = ALIGN(sizeof(tbl->it_userspace[0]) * tbl->it_size, PAGE_SIZE); ··· 186 183 187 184 return 0; 188 185 } 186 + #endif 189 187 190 188 static void tce_iommu_userspace_view_free(struct iommu_table *tbl) 191 189 { ··· 742 738 .free = tce_free_pSeries 743 739 }; 744 740 741 + #ifdef CONFIG_IOMMU_API 745 742 /* 746 743 * When the DMA window properties might have been removed, 747 744 * the parent node has the table_group setup on it. ··· 762 757 763 758 return NULL; 764 759 } 760 + #endif 765 761 766 762 /* 767 763 * Find nearest ibm,dma-window (default DMA window) or direct DMA window or ··· 1851 1845 return false; 1852 1846 } 1853 1847 1848 + #ifdef CONFIG_IOMMU_API 1854 1849 /* 1855 1850 * A simple iommu_table_group_ops which only allows reusing the existing 1856 1851 * iommu_table. This handles VFIO for POWER7 or the nested KVM. ··· 2334 2327 .take_ownership = spapr_tce_take_ownership, 2335 2328 .release_ownership = spapr_tce_release_ownership, 2336 2329 }; 2330 + #endif 2337 2331 2338 2332 static int iommu_mem_notifier(struct notifier_block *nb, unsigned long action, 2339 2333 void *data)