Skip to contentSkip to conversation

iommu/dma: fix function declaration

PATCH Applied Arnd Bergmann 3 participants 3 messages May 18, 2017 – May 19, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iommu/dma: fix function declaration

Newly added code in the ipmmu-vmsa driver showed a small mistake in a header file that can't be included by itself without CONFIG_IOMMU_DMA enabled:

In file included from drivers/iommu/ipmmu-vmsa.c:13:0:
include/linux/dma-iommu.h:105:94: error: 'struct device' declared inside parameter list will not be visible outside of this definition or declaration [-Werror]

This adds a forward declaration for 'struct device', similar to how we treat the other struct types in this case.

Fixes 3ae47292024f ("iommu/ipmmu-vmsa: Add new IOMMU_DOMAIN_DMA ops")
Fixes 273df9635385 ("iommu/dma: Make PCI window reservation generic")
---
 include/linux/dma-iommu.h | 1 +
 1 file changed, 1 insertion(+)
include/linux/dma-iommu.h +1 -0
index 4eac2670bfa1..92f20832fd28 100644
@@ -78,6 +78,7 @@ void iommu_dma_get_resv_regions(struct device *dev, struct list_head *list);
 
 struct iommu_domain;
 struct msi_msg;
+struct device;
 
 static inline int iommu_dma_init(void)
 {
Signature · 1 line
2.9.0
Acked-by on v1 1/1
#1 lore raw
Quoted 9 lines · Arnd Bergmann

Newly added code in the ipmmu-vmsa driver showed a small mistake in a header file that can't be included by itself without CONFIG_IOMMU_DMA enabled:

In file included from drivers/iommu/ipmmu-vmsa.c:13:0:
include/linux/dma-iommu.h:105:94: error: 'struct device' declared inside parameter list will not be visible outside of this definition or declaration [-Werror]

This adds a forward declaration for 'struct device', similar to how we treat the other struct types in this case.

Oops, looks like this was latent from day one, thanks Arnd.

Quoted 20 lines
Fixes 3ae47292024f ("iommu/ipmmu-vmsa: Add new IOMMU_DOMAIN_DMA ops")
Fixes 273df9635385 ("iommu/dma: Make PCI window reservation generic")
---
 include/linux/dma-iommu.h | 1 +
 1 file changed, 1 insertion(+)
include/linux/dma-iommu.h +1 -0
index 4eac2670bfa1..92f20832fd28 100644
@@ -78,6 +78,7 @@ void iommu_dma_get_resv_regions(struct device *dev, struct list_head *list);
 
 struct iommu_domain;
 struct msi_msg;
+struct device;
 
 static inline int iommu_dma_init(void)
 {
Applied
#2 lore raw
In reply to Arnd Bergmann
Quoted 7 lines · Arnd Bergmann

Newly added code in the ipmmu-vmsa driver showed a small mistake in a header file that can't be included by itself without CONFIG_IOMMU_DMA enabled:

In file included from drivers/iommu/ipmmu-vmsa.c:13:0:
include/linux/dma-iommu.h:105:94: error: 'struct device' declared inside parameter list will not be visible outside of this definition or declaration [-Werror]

Quoted 6 lines

This adds a forward declaration for 'struct device', similar to how we treat the other struct types in this case.

Fixes 3ae47292024f ("iommu/ipmmu-vmsa: Add new IOMMU_DOMAIN_DMA ops")
Fixes 273df9635385 ("iommu/dma: Make PCI window reservation generic")

Applied, thanks.