[PATCH] dmar: use function stubs when CONFIG_INTR_REMAP is disabled

From: Randy Dunlap
Date: Mon Nov 22 2010 - 15:50:58 EST


From: Randy Dunlap <randy.dunlap@xxxxxxxxxx>

The stubs for CONFIG_INTR_REMAP disabled need to be functions
instead of values to eliminate build warnings.

arch/x86/kernel/apic/apic.c: In function 'lapic_suspend':
arch/x86/kernel/apic/apic.c:2060:3: warning: statement with no effect
arch/x86/kernel/apic/apic.c: In function 'lapic_resume':
arch/x86/kernel/apic/apic.c:2137:3: warning: statement with no effect

Signed-off-by: Randy Dunlap <randy.dunlap@xxxxxxxxxx>
Reported-by: Fabio Comolli <fabio.comolli@xxxxxxxxx>
---
include/linux/dmar.h | 17 ++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)

--- lnx-2637-rc3.orig/include/linux/dmar.h
+++ lnx-2637-rc3/include/linux/dmar.h
@@ -175,10 +175,21 @@ static inline int set_msi_sid(struct irt
return 0;
}

-#define enable_intr_remapping(mode) (-1)
-#define disable_intr_remapping() (0)
-#define reenable_intr_remapping(mode) (0)
#define intr_remapping_enabled (0)
+
+static inline int enable_intr_remapping(int eim)
+{
+ return -1;
+}
+
+static inline void disable_intr_remapping(void)
+{
+}
+
+static inline int reenable_intr_remapping(int eim)
+{
+ return 0;
+}
#endif

/* Can't use the common MSI interrupt functions
--
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/