Skip to content

Commit ac7ded2

Browse files
fujitaIngo Molnar
authored andcommitted
x86: remove ifdef CONFIG_GART_IOMMU in pci-dma.c
Our way to handle gart_* functions for CONFIG_GART_IOMMU and !CONFIG_GART_IOMMU cases is inconsistent. We have some dummy gart_* functions in !CONFIG_GART_IOMMU case and also use ifdef CONFIG_GART_IOMMU tricks in pci-dma.c to call some gart_* functions in only CONFIG_GART_IOMMU case. This patch removes ifdef CONFIG_GART_IOMMU in pci-dma.c and always use dummy gart_* functions in iommu.h. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Acked-by: Muli Ben-Yehuda <muli@il.ibm.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
1 parent 46a7fa2 commit ac7ded2

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

arch/x86/kernel/pci-dma.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,7 @@ void __init pci_iommu_alloc(void)
114114
* The order of these functions is important for
115115
* fall-back/fail-over reasons
116116
*/
117-
#ifdef CONFIG_GART_IOMMU
118117
gart_iommu_hole_init();
119-
#endif
120118

121119
#ifdef CONFIG_CALGARY_IOMMU
122120
detect_calgary();
@@ -184,9 +182,7 @@ static __init int iommu_setup(char *p)
184182
swiotlb = 1;
185183
#endif
186184

187-
#ifdef CONFIG_GART_IOMMU
188185
gart_parse_options(p);
189-
#endif
190186

191187
#ifdef CONFIG_CALGARY_IOMMU
192188
if (!strncmp(p, "calgary", 7))
@@ -508,9 +504,7 @@ static int __init pci_iommu_init(void)
508504

509505
amd_iommu_init();
510506

511-
#ifdef CONFIG_GART_IOMMU
512507
gart_iommu_init();
513-
#endif
514508

515509
no_iommu_init();
516510
return 0;

include/asm-x86/iommu.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,18 @@ extern void gart_iommu_hole_init(void);
2525
static inline void early_gart_iommu_check(void)
2626
{
2727
}
28-
28+
static inline void gart_iommu_init(void)
29+
{
30+
}
2931
static inline void gart_iommu_shutdown(void)
3032
{
3133
}
34+
static inline void gart_parse_options(char *options)
35+
{
36+
}
37+
static inline void gart_iommu_hole_init(void)
38+
{
39+
}
3240
#endif
3341

3442
#endif

0 commit comments

Comments
 (0)