Skip to contentSkip to conversation

dmar: Fix statement with no effect warning in include/linux/dmar.h

PATCH New Kevin Winchester 1 participant 1 message Jul 5, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dmar: Fix statement with no effect warning in include/linux/dmar.h

In the CONFIG_INTR_REMAP=N case, most dmar functions become one- line static inline functions. However a few functions were instead defined to constants. This causes the following warnings for me:

arch/x86/kernel/apic/apic.c: In function ‘lapic_suspend’:
arch/x86/kernel/apic/apic.c:2014:3: warning: statement with no effect arch/x86/kernel/apic/apic.c: In function ‘lapic_resume’:
arch/x86/kernel/apic/apic.c:2091:3: warning: statement with no effect

Correct these warnings by converting the defines into static inline functions instead.

---
 include/linux/dmar.h |   19 +++++++++++++++----
 1 files changed, 15 insertions(+), 4 deletions(-)
include/linux/dmar.h +15 -4
index d7cecc9..f6fcece 100644
@@ -176,11 +176,22 @@ static inline int set_msi_sid(struct irte *irte, struct pci_dev *dev)
 {
 	return 0;
 }
+static inline int irq_remapped(int irq)
+{
+	return 0;
+}
+static inline int enable_intr_remapping(int mode)
+{
+	return -1;
+}
+static inline void disable_intr_remapping(void)
+{
+}
+static inline int reenable_intr_remapping(int mode)
+{
+	return 0;
+}
 
-#define irq_remapped(irq)		(0)
-#define enable_intr_remapping(mode)	(-1)
-#define disable_intr_remapping()	(0)
-#define reenable_intr_remapping(mode)	(0)
 #define intr_remapping_enabled		(0)
 #endif
 
Signature · 1 line
1.7.1