public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] iommu: Remove stub functions for !CONFIG_IOMMU_API
@ 2011-08-26 13:20 Joerg Roedel
  2011-08-27 11:56 ` Ohad Ben-Cohen
  0 siblings, 1 reply; 10+ messages in thread
From: Joerg Roedel @ 2011-08-26 13:20 UTC (permalink / raw)
  To: iommu
  Cc: linux-kernel, David Woodhouse, Ohad Ben-Cohen, David Brown,
	Stepan Moskovchenko, Joerg Roedel

Remove most of the stub functions because they are only
allowed to use when CONFIG_IOMMU_API is set anyway. This
will catch missing 'select' entries in kconfig at compile
time already.

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
---
 include/linux/iommu.h |   52 +-----------------------------------------------
 1 files changed, 2 insertions(+), 50 deletions(-)

diff --git a/include/linux/iommu.h b/include/linux/iommu.h
index 9940319..296f41a 100644
--- a/include/linux/iommu.h
+++ b/include/linux/iommu.h
@@ -19,6 +19,8 @@
 #ifndef __LINUX_IOMMU_H
 #define __LINUX_IOMMU_H
 
+#ifdef CONFIG_IOMMU_API
+
 #include <linux/errno.h>
 
 #define IOMMU_READ	(1)
@@ -49,8 +51,6 @@ struct iommu_ops {
 			      unsigned long cap);
 };
 
-#ifdef CONFIG_IOMMU_API
-
 extern void register_iommu(struct iommu_ops *ops);
 extern bool iommu_found(void);
 extern struct iommu_domain *iommu_domain_alloc(void);
@@ -70,59 +70,11 @@ extern int iommu_domain_has_cap(struct iommu_domain *domain,
 
 #else /* CONFIG_IOMMU_API */
 
-static inline void register_iommu(struct iommu_ops *ops)
-{
-}
-
 static inline bool iommu_found(void)
 {
 	return false;
 }
 
-static inline struct iommu_domain *iommu_domain_alloc(void)
-{
-	return NULL;
-}
-
-static inline void iommu_domain_free(struct iommu_domain *domain)
-{
-}
-
-static inline int iommu_attach_device(struct iommu_domain *domain,
-				      struct device *dev)
-{
-	return -ENODEV;
-}
-
-static inline void iommu_detach_device(struct iommu_domain *domain,
-				       struct device *dev)
-{
-}
-
-static inline int iommu_map(struct iommu_domain *domain, unsigned long iova,
-			    phys_addr_t paddr, int gfp_order, int prot)
-{
-	return -ENODEV;
-}
-
-static inline int iommu_unmap(struct iommu_domain *domain, unsigned long iova,
-			      int gfp_order)
-{
-	return -ENODEV;
-}
-
-static inline phys_addr_t iommu_iova_to_phys(struct iommu_domain *domain,
-					     unsigned long iova)
-{
-	return 0;
-}
-
-static inline int domain_has_cap(struct iommu_domain *domain,
-				 unsigned long cap)
-{
-	return 0;
-}
-
 #endif /* CONFIG_IOMMU_API */
 
 #endif /* __LINUX_IOMMU_H */
-- 
1.7.4.1



^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2011-09-02  0:57 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-26 13:20 [PATCH] iommu: Remove stub functions for !CONFIG_IOMMU_API Joerg Roedel
2011-08-27 11:56 ` Ohad Ben-Cohen
2011-08-29 10:15   ` Roedel, Joerg
2011-08-29 10:59     ` Ohad Ben-Cohen
2011-08-29 12:25       ` Roedel, Joerg
2011-08-29 12:55         ` Ohad Ben-Cohen
2011-08-29 13:05           ` Roedel, Joerg
2011-08-29 13:21             ` Ohad Ben-Cohen
2011-08-31 13:03               ` Roedel, Joerg
2011-09-02  0:57                 ` Laura Abbott

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox