LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jesse Larrew <jlarrew@linux.vnet.ibm.com>
To: linuxppc-dev@lists.ozlabs.org
Cc: markn@au1.ibm.com, tbreeds@au1.ibm.com, lkessler@us.ibm.com,
	Jesse Larrew <jlarrew@linux.vnet.ibm.com>,
	mjwolf@us.ibm.com
Subject: [PATCH 4/4] powerpc/pseries: Reorder VPHN functions to reduce forward declarations
Date: Thu, 20 Jan 2011 22:01:57 -0700	[thread overview]
Message-ID: <20110121050156.5062.81631.sendpatchset@oc7304238415.ibm.com> (raw)
In-Reply-To: <20110121050010.5062.3390.sendpatchset@oc7304238415.ibm.com>

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

Reorder VPHN functions to reduce the need for forward declarations.

Signed-off-by: Jesse Larrew <jlarrew@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

      parent reply	other threads:[~2011-01-21  5:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-21  5:00 [PATCH 0/4] powerpc/pseries: VPHN code cleanups Jesse Larrew
2011-01-21  5:00 ` [PATCH 1/4] powerpc/pseries: Fix typo in VPHN comments Jesse Larrew
2011-01-21  5:01 ` [PATCH 2/4] powerpc/pseries: Fix brace placement in numa.c Jesse Larrew
2011-01-21  5:01 ` [PATCH 3/4] powerpc/pseries: Remove unnecessary variable initializations " Jesse Larrew
2011-01-21  5:01 ` Jesse Larrew [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110121050156.5062.81631.sendpatchset@oc7304238415.ibm.com \
    --to=jlarrew@linux.vnet.ibm.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=lkessler@us.ibm.com \
    --cc=markn@au1.ibm.com \
    --cc=mjwolf@us.ibm.com \
    --cc=tbreeds@au1.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox