From: Jesse Larrew <jlar...@linux.vnet.ibm.com>

Reorder VPHN functions to reduce the need for forward declarations.

Signed-off-by: Jesse Larrew <jlar...@linux.vnet.ibm.com>
---
 arch/powerpc/mm/numa.c |  115 ++++++++++++++++++++++++------------------------
 1 files changed, 57 insertions(+), 58 deletions(-)

diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c
index f7971d2..2010a17 100644
--- a/arch/powerpc/mm/numa.c
+++ b/arch/powerpc/mm/numa.c
@@ -1270,7 +1270,6 @@ static u8 
vphn_cpu_change_counts[NR_CPUS][VPHN_NR_CHANGE_CTRS];
 static cpumask_t cpu_associativity_changes_mask;
 static int vphn_enabled;
 static void set_topology_timer(void);
-int stop_topology_update(void);
 
 /*
  * Store the current values of the associativity change counters in the
@@ -1328,6 +1327,63 @@ static int update_cpu_associativity_changes_mask(void)
        return nr_cpus;
 }
 
+static void topology_work_fn(struct work_struct *work)
+{
+       rebuild_sched_domains();
+}
+static DECLARE_WORK(topology_work, topology_work_fn);
+
+void topology_schedule_update(void)
+{
+       schedule_work(&topology_work);
+}
+
+static void topology_timer_fn(unsigned long ignored)
+{
+       if (!vphn_enabled)
+               return;
+       if (update_cpu_associativity_changes_mask() > 0)
+               topology_schedule_update();
+       set_topology_timer();
+}
+static struct timer_list topology_timer =
+       TIMER_INITIALIZER(topology_timer_fn, 0, 0);
+
+static void set_topology_timer(void)
+{
+       topology_timer.data = 0;
+       topology_timer.expires = jiffies + 60 * HZ;
+       add_timer(&topology_timer);
+}
+
+/*
+ * Start polling for VPHN associativity changes.
+ */
+int start_topology_update(void)
+{
+       int rc = 0;
+
+       if (firmware_has_feature(FW_FEATURE_VPHN)) {
+               vphn_enabled = 1;
+               setup_cpu_associativity_change_counters();
+               init_timer_deferrable(&topology_timer);
+               set_topology_timer();
+               rc = 1;
+       }
+
+       return rc;
+}
+__initcall(start_topology_update);
+
+/*
+ * Disable polling for VPHN associativity changes.
+ */
+int stop_topology_update(void)
+{
+       vphn_enabled = 0;
+       return del_timer_sync(&topology_timer);
+}
+
 /* 6 64-bit registers unpacked into 12 32-bit associativity values */
 #define VPHN_ASSOC_BUFSIZE (6*sizeof(u64)/sizeof(u32))
 
@@ -1446,61 +1502,4 @@ int arch_update_cpu_topology(void)
 
        return 1;
 }
-
-static void topology_work_fn(struct work_struct *work)
-{
-       rebuild_sched_domains();
-}
-static DECLARE_WORK(topology_work, topology_work_fn);
-
-void topology_schedule_update(void)
-{
-       schedule_work(&topology_work);
-}
-
-static void topology_timer_fn(unsigned long ignored)
-{
-       if (!vphn_enabled)
-               return;
-       if (update_cpu_associativity_changes_mask() > 0)
-               topology_schedule_update();
-       set_topology_timer();
-}
-static struct timer_list topology_timer =
-       TIMER_INITIALIZER(topology_timer_fn, 0, 0);
-
-static void set_topology_timer(void)
-{
-       topology_timer.data = 0;
-       topology_timer.expires = jiffies + 60 * HZ;
-       add_timer(&topology_timer);
-}
-
-/*
- * Start polling for VPHN associativity changes.
- */
-int start_topology_update(void)
-{
-       int rc = 0;
-
-       if (firmware_has_feature(FW_FEATURE_VPHN)) {
-               vphn_enabled = 1;
-               setup_cpu_associativity_change_counters();
-               init_timer_deferrable(&topology_timer);
-               set_topology_timer();
-               rc = 1;
-       }
-
-       return rc;
-}
-__initcall(start_topology_update);
-
-/*
- * Disable polling for VPHN associativity changes.
- */
-int stop_topology_update(void)
-{
-       vphn_enabled = 0;
-       return del_timer_sync(&topology_timer);
-}
 #endif /* CONFIG_PPC_SPLPAR */
-- 
1.7.3.4

_______________________________________________
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Reply via email to