Skip to contentSkip to conversation

drivers/macintosh/via-pmu.c compile fix

TRIVIAL Gergely Nagy 1 participant 1 message Sep 3, 2003

lore
Share & tools
lore
#0 lore raw

Hi!

While compiling linux 2.6.0-test4-bk4, I got a weird error that some initializers are not constants, in the pmu_handle_data() function. Looking at the given line, there were EXPORT_SYMBOLs, so I suspected that there's a missing brace somewhere. And that was it:
when CONFIG_PMAC_PBOOK is not set, the last if branch is not closed. Adding an #else } #endif fixes the problem, patch attached below.

While there, I also added another #ifdef (probably not too nice, and there is most certainly a better way) to fix a minor compile warning about `i' being used uninitialised in via_pmu_dev_init. This patch is also attached below.

Signature · 27 lines
Gergely Nagy

--- drivers/macintosh/via-pmu.c.orig	2003-09-03 08:43:10.000000000 +0200
+++ drivers/macintosh/via-pmu.c	2003-09-03 08:42:51.000000000 +0200
@@ -1393,7 +1393,8 @@
 		pmu_pass_intr(data, len);
 	} else
 	       pmu_pass_intr(data, len);
-
+#else
+	}
 #endif /* CONFIG_PMAC_PBOOK */
 	goto next;
 }

--- drivers/macintosh/via-pmu.c.old	2003-09-03 08:42:51.000000000 +0200
+++ drivers/macintosh/via-pmu.c	2003-09-03 08:46:08.000000000 +0200
@@ -493,7 +493,9 @@
 	/* Create /proc/pmu */
 	proc_pmu_root = proc_mkdir("pmu", 0);
 	if (proc_pmu_root) {
+#ifdef CONFIG_PMAC_PBOOK
 		int i;
+#endif
 		proc_pmu_info = create_proc_read_entry("info", 0, proc_pmu_root,
 					proc_get_info, NULL);
 		proc_pmu_irqstats = create_proc_read_entry("interrupts", 0, proc_pmu_root,