Skip to contentSkip to conversation

fix warning in arch/ia64/pci/pci.c

PATCH In review Jesse Barnes 2 participants 3 messages Jan 10, 2005

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fix warning in arch/ia64/pci/pci.c

Bjorn, I think you had a similar fix awhile back?

Fix a 'mixing code and declarations' warning in pci.c by creating a small function that's a no-op if CONFIG_NUMA=n but otherwise includes the proper extern.

Thanks,
Jesse

===== arch/ia64/pci/pci.c 1.60 vs edited =====

arch/ia64/pci/pci.c +14 -5
@@ -131,6 +131,19 @@
 	.write = pci_write,
 };
 
+#ifdef CONFIG_NUMA
+extern acpi_status acpi_map_iosapic(acpi_handle, u32, void *, void **);
+static void acpi_map_iosapics(void)
+{
+	acpi_get_devices(NULL, acpi_map_iosapic, NULL, NULL);
+}
+#else
+static void acpi_map_iosapics(void)
+{
+	return;
+}
+#endif /* CONFIG_NUMA */
+
 static int __init
 pci_acpi_init (void)
 {
@@ -138,11 +151,7 @@
 
 	printk(KERN_INFO "PCI: Using ACPI for IRQ routing\n");
 
-#ifdef CONFIG_NUMA
-extern acpi_status acpi_map_iosapic (acpi_handle, u32, void*, void**);
-
-	acpi_get_devices(NULL, acpi_map_iosapic, NULL, NULL);
-#endif
+	acpi_map_iosapics();
 
 	if (pci_routeirq) {
 		/*
#1 lore raw
Quoted 1 line · Jesse Barnes

Bjorn, I think you had a similar fix awhile back?

Was me actually ... mine looked like this:

+#ifdef CONFIG_NUMA
+extern acpi_status acpi_map_iosapic (acpi_handle, u32, void*, void**); +#define map_apics() acpi_get_devices(NULL, acpi_map_iosapic, NULL, NULL); +#else
+#define map_apics() do { } while (0);
+#endif
+
[...]
-#ifdef CONFIG_NUMA
-extern acpi_status acpi_map_iosapic (acpi_handle, u32, void*, void**); -
- acpi_get_devices(NULL, acpi_map_iosapic, NULL, NULL);
-#endif
+ map_apics();

but yours has probbaly even been compiled, and stuff.

Quoted 44 lines

Fix a 'mixing code and declarations' warning in pci.c by creating a small function that's a no-op if CONFIG_NUMA=n but otherwise includes the proper extern.

Thanks,
Jesse

=== arch/ia64/pci/pci.c 1.60 vs edited ==> --- 1.60/arch/ia64/pci/pci.c 2005-01-04 18:48:18 -08:00
+++ edited/arch/ia64/pci/pci.c 2005-01-06 17:49:11 -08:00

arch/ia64/pci/pci.c +14 -5
@@ -131,6 +131,19 @@
 	.write = pci_write,
 };
 
+#ifdef CONFIG_NUMA
+extern acpi_status acpi_map_iosapic(acpi_handle, u32, void *, void **);
+static void acpi_map_iosapics(void)
+{
+	acpi_get_devices(NULL, acpi_map_iosapic, NULL, NULL);
+}
+#else
+static void acpi_map_iosapics(void)
+{
+	return;
+}
+#endif /* CONFIG_NUMA */
+
 static int __init
 pci_acpi_init (void)
 {
@@ -138,11 +151,7 @@
 
 	printk(KERN_INFO "PCI: Using ACPI for IRQ routing\n");
 
-#ifdef CONFIG_NUMA
-extern acpi_status acpi_map_iosapic (acpi_handle, u32, void*, void**);
-
-	acpi_get_devices(NULL, acpi_map_iosapic, NULL, NULL);
-#endif
+	acpi_map_iosapics();
 
 	if (pci_routeirq) {
 		/*
Signature · 6 lines
"Next the statesmen will invent cheap lies, putting the blame upon 
the nation that is attacked, and every man will be glad of those
conscience-soothing falsities, and will diligently study them, and refuse
to examine any refutations of them; and thus he will by and by convince 
himself that the war is just, and will thank God for the better sleep 
he enjoys after this process of grotesque self-deception." -- Mark Twain
#2 lore raw
In reply to Jesse Barnes
Quoted 20 lines · Matthew Wilcox
Quoted 1 line · Jesse Barnes

Bjorn, I think you had a similar fix awhile back?

Was me actually ... mine looked like this:

(quoted diff) +8 -5
+#ifdef CONFIG_NUMA
+extern acpi_status acpi_map_iosapic (acpi_handle, u32, void*, void**);
+#define map_apics() acpi_get_devices(NULL, acpi_map_iosapic, NULL, NULL);
+#else
+#define map_apics() do { } while (0);
+#endif
+
[...]
-#ifdef CONFIG_NUMA
-extern acpi_status acpi_map_iosapic (acpi_handle, u32, void*, void**);
-
-       acpi_get_devices(NULL, acpi_map_iosapic, NULL, NULL);
-#endif
+       map_apics();
Quoted 1 line

but yours has probbaly even been compiled, and stuff.

Yeah, but I'm happy with either one, they look equivalent (except yours has ';' at the end of the #defines).

Thanks,
Jesse