[PATCH] iommu: Remove stub functions for !CONFIG_IOMMU_API

From: Joerg Roedel
Date: Fri Aug 26 2011 - 09:21:03 EST


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@xxxxxxx>
---
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


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/