login
Header Space

 
 

[Patch 4/5] run drivers/misc/xp through scripts/Lindent -v2

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <jes@...>, <tony.luck@...>, <linux-kernel@...>, <linux-ia64@...>
Date: Wednesday, March 26, 2008 - 12:52 pm

Ran patches through scripts/Lindent.

Signed-off-by: Dean Nelson <dcn@sgi.com>

---

 drivers/misc/xp/xp.h            |  115 ++++------
 drivers/misc/xp/xp_main.c       |  109 ++++------
 drivers/misc/xp/xp_sn2.c        |   52 ++--
 drivers/misc/xp/xp_uv.c         |    7
 drivers/misc/xp/xpc.h           |  368 ++++++++++++++--------------------
 drivers/misc/xp/xpc_channel.c   |  379 +++++++++++++-----------------------
 drivers/misc/xp/xpc_main.c      |  329 +++++++++++++------------------
 drivers/misc/xp/xpc_partition.c |  168 +++++----------
 drivers/misc/xp/xpnet.c         |   95 +++------
 9 files changed, 661 insertions(+), 961 deletions(-)

Index: linux-2.6/drivers/misc/xp/xp.h
===================================================================
--- linux-2.6.orig/drivers/misc/xp/xp.h	2008-03-26 10:41:15.000000000 -0500
+++ linux-2.6/drivers/misc/xp/xp.h	2008-03-26 10:57:58.792002890 -0500
@@ -6,16 +6,13 @@
  * Copyright (C) 2004-2008 Silicon Graphics, Inc. All rights reserved.
  */
 
-
 /*
  * External Cross Partition (XP) structures and defines.
  */
 
-
 #ifndef _DRIVERS_MISC_XP_XP_H
 #define _DRIVERS_MISC_XP_XP_H
 
-
 #include <linux/cache.h>
 #include <linux/hardirq.h>
 #include <linux/mutex.h>
@@ -35,14 +32,12 @@
 #error architecture is NOT supported
 #endif
 
-
 #ifdef USE_DBUG_ON
 #define DBUG_ON(condition)	BUG_ON(condition)
 #else
 #define DBUG_ON(condition)
 #endif
 
-
 #ifndef is_shub1
 #define is_shub1()	0
 #endif
@@ -59,7 +54,6 @@
 #define is_uv()		0
 #endif
 
-
 /*
  * Define the maximum number of logically defined partitions the system
  * can support. It is constrained by the maximum number of hardware
@@ -78,10 +72,9 @@
 #error  XP_NPARTITIONS exceeds MAXIMUM possible.
 #endif
 
-#define XP_MIN_PARTID		1			/* inclusive */
+#define XP_MIN_PARTID		1	/* inclusive */
 #define XP_MAX_PARTID		(XP_NPARTITIONS - 1)	/* inclusive */
 
-
 /*
  * XPC establishes channel connections between the local partition and any
  * other partition that is currently up. Over these channels, kernel-level
@@ -107,7 +100,6 @@
 #error	XPC_NCHANNELS exceeds MAXIMUM possible.
 #endif
 
-
 /*
  * The format of an XPC message is as follows:
  *
@@ -145,12 +137,10 @@ struct xpc_msg {
 	u64 payload;		/* user defined portion of message */
 };
 
-
 #define XPC_MSG_PAYLOAD_OFFSET	(u64) (&((struct xpc_msg *)0)->payload)
 #define XPC_MSG_SIZE(_payload_size) \
 		L1_CACHE_ALIGN(XPC_MSG_PAYLOAD_OFFSET + (_payload_size))
 
-
 /*
  * Define the return values and values passed to user's callout functions.
  * (It is important to add new value codes at the end just preceding
@@ -237,7 +227,6 @@ enum xp_retval {
 	xpUnknownReason		/* 56: unknown reason (must be last in list) */
 };
 
-
 /* the following are valid xp_set_amo() ops */
 #define XP_AMO_OR	1	/* set variable to (variable | operand) */
 #define XP_AMO_AND	2	/* set variable to (variable & operand) */
@@ -252,7 +241,6 @@ enum xp_retval {
 #define XP_MEMPROT_ALLOW_CPU_MEM	2
 #define XP_MEMPROT_ALLOW_ALL		3	/* Shub 1.1 only */
 
-
 /*
  * Define the callout function types used by XPC to update the user on
  * connection activity and state changes (via the user function registered by
@@ -357,12 +345,11 @@ enum xp_retval {
  * =====================+================================+=====================
  */
 
-typedef void (*xpc_channel_func)(enum xp_retval reason, short partid,
-		int ch_number, void *data, void *key);
-
-typedef void (*xpc_notify_func)(enum xp_retval reason, short partid,
-		int ch_number, void *key);
+typedef void (*xpc_channel_func) (enum xp_retval reason, short partid,
+				  int ch_number, void *data, void *key);
 
+typedef void (*xpc_notify_func) (enum xp_retval reason, short partid,
+				 int ch_number, void *key);
 
 /*
  * The following is a registration entry. There is a global array of these,
@@ -380,50 +367,45 @@ typedef void (*xpc_notify_func)(enum xp_
  */
 struct xpc_registration {
 	struct mutex mutex;
-	xpc_channel_func func;		/* function to call */
-	void *key;			/* pointer to user's key */
-	u16 nentries;			/* #of msg entries in local msg queue */
-	u16 msg_size;			/* message queue's message size */
-	u32 assigned_limit;		/* limit on #of assigned kthreads */
-	u32 idle_limit;			/* limit on #of idle kthreads */
+	xpc_channel_func func;	/* function to call */
+	void *key;		/* pointer to user's key */
+	u16 nentries;		/* #of msg entries in local msg queue */
+	u16 msg_size;		/* message queue's message size */
+	u32 assigned_limit;	/* limit on #of assigned kthreads */
+	u32 idle_limit;		/* limit on #of idle kthreads */
 } ____cacheline_aligned;
 
-
 #define XPC_CHANNEL_REGISTERED(_c)	(xpc_registrations[_c].func != NULL)
 
-
 /* the following are valid xpc_allocate() flags */
-#define XPC_WAIT	0		/* wait flag */
-#define XPC_NOWAIT	1		/* no wait flag */
-
+#define XPC_WAIT	0	/* wait flag */
+#define XPC_NOWAIT	1	/* no wait flag */
 
 struct xpc_interface {
-	void (*connect)(int);
-	void (*disconnect)(int);
-	enum xp_retval (*allocate)(short, int, u32, void **);
-	enum xp_retval (*send)(short, int, void *);
-	enum xp_retval (*send_notify)(short, int, void *,
-						xpc_notify_func, void *);
-	void (*received)(short, int, void *);
-	enum xp_retval (*partid_to_nasids)(short, void *);
+	void (*connect) (int);
+	void (*disconnect) (int);
+	enum xp_retval (*allocate) (short, int, u32, void **);
+	enum xp_retval (*send) (short, int, void *);
+	enum xp_retval (*send_notify) (short, int, void *,
+				       xpc_notify_func, void *);
+	void (*received) (short, int, void *);
+	enum xp_retval (*partid_to_nasids) (short, void *);
 };
 
-
 extern struct xpc_interface xpc_interface;
 
 extern void xpc_set_interface(void (*)(int),
-		void (*)(int),
-		enum xp_retval (*)(short, int, u32, void **),
-		enum xp_retval (*)(short, int, void *),
-		enum xp_retval (*)(short, int, void *, xpc_notify_func,
-								void *),
-		void (*)(short, int, void *),
-		enum xp_retval (*)(short, void *));
+			      void (*)(int),
+			      enum xp_retval (*)(short, int, u32, void **),
+			      enum xp_retval (*)(short, int, void *),
+			      enum xp_retval (*)(short, int, void *,
+						 xpc_notify_func, void *),
+			      void (*)(short, int, void *),
+			      enum xp_retval (*)(short, void *));
 extern void xpc_clear_interface(void);
 
-
 extern enum xp_retval xpc_connect(int, xpc_channel_func, void *, u16,
-						u16, u32, u32);
+				  u16, u32, u32);
 extern void xpc_disconnect(int);
 
 static inline enum xp_retval
@@ -440,7 +422,7 @@ xpc_send(short partid, int ch_number, vo
 
 static inline enum xp_retval
 xpc_send_notify(short partid, int ch_number, void *payload,
-			xpc_notify_func func, void *key)
+		xpc_notify_func func, void *key)
 {
 	return xpc_interface.send_notify(partid, ch_number, payload, func, key);
 }
@@ -460,31 +442,36 @@ xpc_partid_to_nasids(short partid, void 
 extern short xp_partition_id;
 extern u8 xp_region_size;
 extern unsigned long xp_rtc_cycles_per_second;
-extern enum xp_retval (*xp_remote_memcpy)(void *, const void *, size_t);
-extern enum xp_retval (*xp_register_remote_amos)(u64, size_t);
-extern enum xp_retval (*xp_unregister_remote_amos)(u64, size_t);
+extern enum xp_retval (*xp_remote_memcpy) (void *, const void *, size_t);
+extern enum xp_retval (*xp_register_remote_amos) (u64, size_t);
+extern enum xp_retval (*xp_unregister_remote_amos) (u64, size_t);
 extern int xp_sizeof_nasid_mask;
 extern int xp_sizeof_amo;
-extern u64 *(*xp_alloc_amos)(int);
-extern void (*xp_free_amos)(u64 *, int);
-extern enum xp_retval (*xp_set_amo)(u64 *, int, u64, int);
-extern enum xp_retval (*xp_set_amo_with_interrupt)(u64 *, int, u64, int, int,
+extern u64 *(*xp_alloc_amos) (int);
+extern void (*xp_free_amos) (u64 *, int);
+extern enum xp_retval (*xp_set_amo) (u64 *, int, u64, int);
+extern enum xp_retval (*xp_set_amo_with_interrupt) (u64 *, int, u64, int, int,
 						    int, int);
-extern enum xp_retval (*xp_get_amo)(u64 *, int, u64 *);
-extern enum xp_retval (*xp_get_partition_rsvd_page_pa)(u64, u64 *, u64 *,
+extern enum xp_retval (*xp_get_amo) (u64 *, int, u64 *);
+extern enum xp_retval (*xp_get_partition_rsvd_page_pa) (u64, u64 *, u64 *,
 							size_t *);
-extern enum xp_retval (*xp_change_memprotect)(u64, size_t, int, u64 *);
-extern void (*xp_change_memprotect_shub_wars_1_1)(int);
-extern void (*xp_allow_IPI_ops)(void);
-extern void (*xp_disallow_IPI_ops)(void);
+extern enum xp_retval (*xp_change_memprotect) (u64, size_t, int, u64 *);
+extern void (*xp_change_memprotect_shub_wars_1_1) (int);
+extern void (*xp_allow_IPI_ops) (void);
+extern void (*xp_disallow_IPI_ops) (void);
 
-extern int (*xp_cpu_to_nasid)(int);
-extern int (*xp_node_to_nasid)(int);
+extern int (*xp_cpu_to_nasid) (int);
+extern int (*xp_node_to_nasid) (int);
 
 extern u64 xp_nofault_PIOR_target;
 extern int xp_nofault_PIOR(void *);
 extern int xp_error_PIOR(void);
 
+extern struct device *xp;
+extern enum xp_retval xp_init_sn2(void);
+extern enum xp_retval xp_init_uv(void);
+extern void xp_exit_sn2(void);
+extern void xp_exit_uv(void);
 
 static inline int
 xp_partid_mask_words(int npartitions)
@@ -498,6 +485,4 @@ xp_nasid_mask_words(void)
 	return DIV_ROUND_UP(xp_sizeof_nasid_mask, BYTES_PER_WORD);
 }
 
-
 #endif /* _DRIVERS_MISC_XP_XP_H */
-
Index: linux-2.6/drivers/misc/xp/xp_main.c
===================================================================
--- linux-2.6.orig/drivers/misc/xp/xp_main.c	2008-03-26 10:41:24.000000000 -0500
+++ linux-2.6/drivers/misc/xp/xp_main.c	2008-03-26 10:57:58.820006332 -0500
@@ -6,7 +6,6 @@
  * Copyright (c) 2004-2008 Silicon Graphics, Inc.  All Rights Reserved.
  */
 
-
 /*
  * Cross Partition (XP) base.
  *
@@ -15,7 +14,6 @@
  *
  */
 
-
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/device.h>
@@ -28,7 +26,7 @@ struct device_driver xp_dbg_name = {
 };
 
 struct device xp_dbg_subname = {
-	.bus_id = {0},			/* set to "" */
+	.bus_id = {0},		/* set to "" */
 	.driver = &xp_dbg_name
 };
 
@@ -43,66 +41,68 @@ short xp_partition_id;
 u8 xp_region_size;
 unsigned long xp_rtc_cycles_per_second;
 
-enum xp_retval (*xp_remote_memcpy)(void *dst, const void *src, size_t len);
+enum xp_retval (*xp_remote_memcpy) (void *dst, const void *src, size_t len);
 
-enum xp_retval (*xp_register_remote_amos)(u64 paddr, size_t len);
-enum xp_retval (*xp_unregister_remote_amos)(u64 paddr, size_t len);
+enum xp_retval (*xp_register_remote_amos) (u64 paddr, size_t len);
+enum xp_retval (*xp_unregister_remote_amos) (u64 paddr, size_t len);
 
 int xp_sizeof_nasid_mask;
 int xp_sizeof_amo;
 
-u64 *(*xp_alloc_amos)(int n_amos);
-void (*xp_free_amos)(u64 *amos_page, int n_amos);
+u64 *(*xp_alloc_amos) (int n_amos);
+void (*xp_free_amos) (u64 *amos_page, int n_amos);
 
-enum xp_retval (*xp_set_amo)(u64 *amo_va, int op, u64 operand, int remote);
-enum xp_retval (*xp_set_amo_with_interrupt)(u64 *amo_va, int op, u64 operand,
+enum xp_retval (*xp_set_amo) (u64 *amo_va, int op, u64 operand, int remote);
+enum xp_retval (*xp_set_amo_with_interrupt) (u64 *amo_va, int op, u64 operand,
 					     int remote, int nasid,
 					     int phys_cpuid, int vector);
 
-enum xp_retval (*xp_get_amo)(u64 *amo_va, int op, u64 *amo_value_addr);
+enum xp_retval (*xp_get_amo) (u64 *amo_va, int op, u64 *amo_value_addr);
 
-enum xp_retval (*xp_get_partition_rsvd_page_pa)(u64 buf, u64 *cookie,
+enum xp_retval (*xp_get_partition_rsvd_page_pa) (u64 buf, u64 *cookie,
 						 u64 *paddr, size_t *len);
 
-enum xp_retval (*xp_change_memprotect)(u64 paddr, size_t len, int request,
+enum xp_retval (*xp_change_memprotect) (u64 paddr, size_t len, int request,
 					u64 *nasid_array);
-void (*xp_change_memprotect_shub_wars_1_1)(int request);
-void (*xp_allow_IPI_ops)(void);
-void (*xp_disallow_IPI_ops)(void);
-
-int (*xp_cpu_to_nasid)(int cpuid);
-int (*xp_node_to_nasid)(int nid);
+void (*xp_change_memprotect_shub_wars_1_1) (int request);
+void (*xp_allow_IPI_ops) (void);
+void (*xp_disallow_IPI_ops) (void);
 
+int (*xp_cpu_to_nasid) (int cpuid);
+int (*xp_node_to_nasid) (int nid);
 
 /*
  * Initialize the XPC interface to indicate that XPC isn't loaded.
  */
-static enum xp_retval xpc_notloaded(void) { return xpNotLoaded; }
+static enum xp_retval
+xpc_notloaded(void)
+{
+	return xpNotLoaded;
+}
 
 struct xpc_interface xpc_interface = {
-	(void (*)(int)) xpc_notloaded,
-	(void (*)(int)) xpc_notloaded,
-	(enum xp_retval (*)(short, int, u32, void **)) xpc_notloaded,
-	(enum xp_retval (*)(short, int, void *)) xpc_notloaded,
-	(enum xp_retval (*)(short, int, void *, xpc_notify_func, void *))
-							xpc_notloaded,
-	(void (*)(short, int, void *)) xpc_notloaded,
-	(enum xp_retval (*)(short, void *)) xpc_notloaded
+	(void (*)(int))xpc_notloaded,
+	(void (*)(int))xpc_notloaded,
+	(enum xp_retval(*)(short, int, u32, void **))xpc_notloaded,
+	(enum xp_retval(*)(short, int, void *))xpc_notloaded,
+	(enum xp_retval(*)(short, int, void *, xpc_notify_func, void *))
+	    xpc_notloaded,
+	(void (*)(short, int, void *))xpc_notloaded,
+	(enum xp_retval(*)(short, void *))xpc_notloaded
 };
 
-
 /*
  * XPC calls this when it (the XPC module) has been loaded.
  */
 void
-xpc_set_interface(void (*connect)(int),
-		void (*disconnect)(int),
-		enum xp_retval (*allocate)(short, int, u32, void **),
-		enum xp_retval (*send)(short, int, void *),
-		enum xp_retval (*send_notify)(short, int, void *,
-						xpc_notify_func, void *),
-		void (*received)(short, int, void *),
-		enum xp_retval (*partid_to_nasids)(short, void *))
+xpc_set_interface(void (*connect) (int),
+		  void (*disconnect) (int),
+		  enum xp_retval (*allocate) (short, int, u32, void **),
+		  enum xp_retval (*send) (short, int, void *),
+		  enum xp_retval (*send_notify) (short, int, void *,
+						 xpc_notify_func, void *),
+		  void (*received) (short, int, void *),
+		  enum xp_retval (*partid_to_nasids) (short, void *))
 {
 	xpc_interface.connect = connect;
 	xpc_interface.disconnect = disconnect;
@@ -113,35 +113,33 @@ xpc_set_interface(void (*connect)(int),
 	xpc_interface.partid_to_nasids = partid_to_nasids;
 }
 
-
 /*
  * XPC calls this when it (the XPC module) is being unloaded.
  */
 void
 xpc_clear_interface(void)
 {
-	xpc_interface.connect = (void (*)(int)) xpc_notloaded;
-	xpc_interface.disconnect = (void (*)(int)) xpc_notloaded;
-	xpc_interface.allocate = (enum xp_retval (*)(short, int, u32,
-					void **)) xpc_notloaded;
-	xpc_interface.send = (enum xp_retval (*)(short, int, void *))
-					xpc_notloaded;
-	xpc_interface.send_notify = (enum xp_retval (*)(short, int, void *,
-				    xpc_notify_func, void *)) xpc_notloaded;
+	xpc_interface.connect = (void (*)(int))xpc_notloaded;
+	xpc_interface.disconnect = (void (*)(int))xpc_notloaded;
+	xpc_interface.allocate = (enum xp_retval(*)(short, int, u32,
+						    void **))xpc_notloaded;
+	xpc_interface.send = (enum xp_retval(*)(short, int, void *))
+	    xpc_notloaded;
+	xpc_interface.send_notify = (enum xp_retval(*)(short, int, void *,
+						       xpc_notify_func,
+						       void *))xpc_notloaded;
 	xpc_interface.received = (void (*)(short, int, void *))
-					xpc_notloaded;
-	xpc_interface.partid_to_nasids = (enum xp_retval (*)(short, void *))
-					xpc_notloaded;
+	    xpc_notloaded;
+	xpc_interface.partid_to_nasids = (enum xp_retval(*)(short, void *))
+	    xpc_notloaded;
 }
 
-
 /*
  * xpc_registrations[] keeps track of xpc_connect()'s done by the kernel-level
  * users of XPC.
  */
 struct xpc_registration xpc_registrations[XPC_NCHANNELS];
 
-
 /*
  * Register for automatic establishment of a channel connection whenever
  * a partition comes up.
@@ -168,11 +166,10 @@ struct xpc_registration xpc_registration
  */
 enum xp_retval
 xpc_connect(int ch_number, xpc_channel_func func, void *key, u16 payload_size,
-		u16 nentries, u32 assigned_limit, u32 idle_limit)
+	    u16 nentries, u32 assigned_limit, u32 idle_limit)
 {
 	struct xpc_registration *registration;
 
-
 	DBUG_ON(ch_number < 0 || ch_number >= XPC_NCHANNELS);
 	DBUG_ON(payload_size == 0 || nentries == 0);
 	DBUG_ON(func == NULL);
@@ -205,7 +202,6 @@ xpc_connect(int ch_number, xpc_channel_f
 	return xpSuccess;
 }
 
-
 /*
  * Remove the registration for automatic connection of the specified channel
  * when a partition comes up.
@@ -224,7 +220,6 @@ xpc_disconnect(int ch_number)
 {
 	struct xpc_registration *registration;
 
-
 	DBUG_ON(ch_number < 0 || ch_number >= XPC_NCHANNELS);
 
 	registration = &xpc_registrations[ch_number];
@@ -284,6 +279,7 @@ xp_init(void)
 
 	return 0;
 }
+
 module_init(xp_init);
 
 extern void xp_exit_sn2(void);
@@ -297,8 +293,8 @@ xp_exit(void)
 	else if (is_uv())
 		xp_exit_uv();
 }
-module_exit(xp_exit);
 
+module_exit(xp_exit);
 
 MODULE_AUTHOR("Silicon Graphics, Inc.");
 MODULE_DESCRIPTION("Cross Partition (XP) base");
@@ -330,4 +326,3 @@ EXPORT_SYMBOL(xpc_clear_interface);
 EXPORT_SYMBOL(xpc_set_interface);
 EXPORT_SYMBOL(xpc_connect);
 EXPORT_SYMBOL(xpc_disconnect);
-
Index: linux-2.6/drivers/misc/xp/xp_sn2.c
===================================================================
--- linux-2.6.orig/drivers/misc/xp/xp_sn2.c	2008-03-26 10:42:14.000000000 -0500
+++ linux-2.6/drivers/misc/xp/xp_sn2.c	2008-03-26 10:57:58.844009283 -0500
@@ -67,7 +67,7 @@ xp_unregister_nofault_code_sn2(void)
 
 	/* unregister the PIO read nofault code region */
 	(void)sn_register_nofault_code(func_addr, err_func_addr,
-					err_func_addr, 1, 0);
+				       err_func_addr, 1, 0);
 }
 
 /*
@@ -155,15 +155,14 @@ xp_free_amos_sn2(u64 *amos_page, int n_a
 {
 	int n_pages = DIV_ROUND_UP(n_amos * xp_sizeof_amo, PAGE_SIZE);
 
-	uncached_free_page(__IA64_UNCACHED_OFFSET | TO_PHYS((u64) amos_page),
+	uncached_free_page(__IA64_UNCACHED_OFFSET | TO_PHYS((u64)amos_page),
 			   n_pages);
 }
 
-
 static enum xp_retval
 xp_set_amo_sn2(u64 *amo_va, int op, u64 operand, int remote)
 {
-	unsigned long irq_flags = irq_flags; /* eliminate compiler warning */
+	unsigned long irq_flags = irq_flags;	/* eliminate compiler warning */
 	int ret = xpSuccess;
 	/* >>> eliminate remote arg and xp_nofault_PIOR() call */
 
@@ -188,7 +187,8 @@ xp_set_amo_sn2(u64 *amo_va, int op, u64 
 		 * it until the heartbeat times out.
 		 */
 		if (xp_nofault_PIOR((u64 *)GLOBAL_MMR_ADDR(NASID_GET(amo_va),
-				    xp_nofault_PIOR_target)) != 0)
+							   xp_nofault_PIOR_target))
+		    != 0)
 			ret = xpPioReadError;
 
 		local_irq_restore(irq_flags);
@@ -201,7 +201,7 @@ static enum xp_retval
 xp_set_amo_with_interrupt_sn2(u64 *amo_va, int op, u64 operand, int remote,
 			      int nasid, int phys_cpuid, int vector)
 {
-	unsigned long irq_flags = irq_flags; /* eliminate compiler warning */
+	unsigned long irq_flags = irq_flags;	/* eliminate compiler warning */
 	int ret = xpSuccess;
 
 	if (op == XP_AMO_AND)
@@ -226,7 +226,8 @@ xp_set_amo_with_interrupt_sn2(u64 *amo_v
 		 * it until the heartbeat times out.
 		 */
 		if (xp_nofault_PIOR((u64 *)GLOBAL_MMR_ADDR(NASID_GET(amo_va),
-				    xp_nofault_PIOR_target)) != 0)
+							   xp_nofault_PIOR_target))
+		    != 0)
 			ret = xpPioReadError;
 
 		local_irq_restore(irq_flags);
@@ -321,22 +322,28 @@ xp_change_memprotect_shub_wars_1_1_sn2(i
 			nasid = cnodeid_to_nasid(node);
 			/* save current protection values */
 			xpc_prot_vec[node] =
-				(u64)HUB_L((u64 *)GLOBAL_MMR_ADDR(nasid,
-					   SH1_MD_DQLP_MMR_DIR_PRIVEC0));
+			    (u64)HUB_L((u64 *)GLOBAL_MMR_ADDR(nasid,
+							      SH1_MD_DQLP_MMR_DIR_PRIVEC0));
 			/* open up everything */
 			HUB_S((u64 *)GLOBAL_MMR_ADDR(nasid,
-			      SH1_MD_DQLP_MMR_DIR_PRIVEC0), -1UL);
-			HUB_S((u64 *)GLOBAL_MMR_ADDR(nasid,
-			      SH1_MD_DQRP_MMR_DIR_PRIVEC0), -1UL);
+						     SH1_MD_DQLP_MMR_DIR_PRIVEC0),
+			      -1UL);
+			HUB_S((u64 *)
+			      GLOBAL_MMR_ADDR(nasid,
+					      SH1_MD_DQRP_MMR_DIR_PRIVEC0),
+			      -1UL);
 		}
 	} else if (request == XP_MEMPROT_DISALLOW_ALL) {
 		for_each_online_node(node) {
 			nasid = cnodeid_to_nasid(node);
 			/* restore original protection values */
 			HUB_S((u64 *)GLOBAL_MMR_ADDR(nasid,
-			      SH1_MD_DQLP_MMR_DIR_PRIVEC0), xpc_prot_vec[node]);
-			HUB_S((u64 *)GLOBAL_MMR_ADDR(nasid,
-			      SH1_MD_DQRP_MMR_DIR_PRIVEC0), xpc_prot_vec[node]);
+						     SH1_MD_DQLP_MMR_DIR_PRIVEC0),
+			      xpc_prot_vec[node]);
+			HUB_S((u64 *)
+			      GLOBAL_MMR_ADDR(nasid,
+					      SH1_MD_DQRP_MMR_DIR_PRIVEC0),
+			      xpc_prot_vec[node]);
 		}
 	} else
 		BUG();
@@ -361,13 +368,13 @@ xp_allow_IPI_ops_sn2(void)
 	/*  >>> The following should get moved into SAL. */
 	if (is_shub2()) {
 		xpc_sh2_IPI_access0 =
-			(u64)HUB_L((u64 *)LOCAL_MMR_ADDR(SH2_IPI_ACCESS0));
+		    (u64)HUB_L((u64 *)LOCAL_MMR_ADDR(SH2_IPI_ACCESS0));
 		xpc_sh2_IPI_access1 =
-			(u64)HUB_L((u64 *)LOCAL_MMR_ADDR(SH2_IPI_ACCESS1));
+		    (u64)HUB_L((u64 *)LOCAL_MMR_ADDR(SH2_IPI_ACCESS1));
 		xpc_sh2_IPI_access2 =
-			(u64)HUB_L((u64 *)LOCAL_MMR_ADDR(SH2_IPI_ACCESS2));
+		    (u64)HUB_L((u64 *)LOCAL_MMR_ADDR(SH2_IPI_ACCESS2));
 		xpc_sh2_IPI_access3 =
-			(u64)HUB_L((u64 *)LOCAL_MMR_ADDR(SH2_IPI_ACCESS3));
+		    (u64)HUB_L((u64 *)LOCAL_MMR_ADDR(SH2_IPI_ACCESS3));
 
 		for_each_online_node(node) {
 			nasid = cnodeid_to_nasid(node);
@@ -382,7 +389,7 @@ xp_allow_IPI_ops_sn2(void)
 		}
 	} else {
 		xpc_sh1_IPI_access =
-			(u64)HUB_L((u64 *)LOCAL_MMR_ADDR(SH1_IPI_ACCESS));
+		    (u64)HUB_L((u64 *)LOCAL_MMR_ADDR(SH1_IPI_ACCESS));
 
 		for_each_online_node(node) {
 			nasid = cnodeid_to_nasid(node);
@@ -455,7 +462,7 @@ xp_init_sn2(void)
 	 * reflect its existence.
 	 */
 	BUG_ON(offsetof(AMO_t, variable) != 0);
-	BUG_ON(sizeof(((AMO_t *)NULL)->variable) != sizeof(u64));
+	BUG_ON(sizeof(((AMO_t *) NULL)->variable) != sizeof(u64));
 	xp_sizeof_amo = sizeof(AMO_t);
 	xp_alloc_amos = xp_alloc_amos_sn2;
 	xp_free_amos = xp_free_amos_sn2;
@@ -467,7 +474,7 @@ xp_init_sn2(void)
 
 	xp_change_memprotect = xp_change_memprotect_sn2;
 	xp_change_memprotect_shub_wars_1_1 =
-				xp_change_memprotect_shub_wars_1_1_sn2;
+	    xp_change_memprotect_shub_wars_1_1_sn2;
 	xp_allow_IPI_ops = xp_allow_IPI_ops_sn2;
 	xp_disallow_IPI_ops = xp_disallow_IPI_ops_sn2;
 
@@ -484,4 +491,3 @@ xp_exit_sn2(void)
 
 	xp_unregister_nofault_code_sn2();
 }
-
Index: linux-2.6/drivers/misc/xp/xp_uv.c
===================================================================
--- linux-2.6.orig/drivers/misc/xp/xp_uv.c	2008-03-26 10:40:10.000000000 -0500
+++ linux-2.6/drivers/misc/xp/xp_uv.c	2008-03-26 10:57:58.868012234 -0500
@@ -154,8 +154,8 @@ xp_init_uv(void)
 {
 	BUG_ON(!is_uv());
 
-	xp_partition_id = 0;		/* >>> not correct value */
-	xp_region_size = 0;		/* >>> not correct value */
+	xp_partition_id = 0;	/* >>> not correct value */
+	xp_region_size = 0;	/* >>> not correct value */
 	xp_rtc_cycles_per_second = 0;	/* >>> not correct value */
 
 	xp_remote_memcpy = xp_remote_memcpy_uv;
@@ -174,7 +174,7 @@ xp_init_uv(void)
 
 	xp_change_memprotect = xp_change_memprotect_uv;
 	xp_change_memprotect_shub_wars_1_1 =
-				xp_change_memprotect_shub_wars_1_1_uv;
+	    xp_change_memprotect_shub_wars_1_1_uv;
 	xp_allow_IPI_ops = xp_allow_IPI_ops_uv;
 	xp_disallow_IPI_ops = xp_disallow_IPI_ops_uv;
 
@@ -191,4 +191,3 @@ xp_exit_uv(void)
 
 	xp_unregister_nofault_code_uv();
 }
-
Index: linux-2.6/drivers/misc/xp/xpc.h
===================================================================
--- linux-2.6.orig/drivers/misc/xp/xpc.h	2008-03-26 10:41:38.000000000 -0500
+++ linux-2.6/drivers/misc/xp/xpc.h	2008-03-26 10:57:58.884014201 -0500
@@ -6,7 +6,6 @@
  * Copyright (c) 2004-2008 Silicon Graphics, Inc.  All Rights Reserved.
  */
 
-
 /*
  * Cross Partition Communication (XPC) structures and macros.
  */
@@ -14,7 +13,6 @@
 #ifndef _DRIVERS_MISC_XP_XPC_H
 #define _DRIVERS_MISC_XP_XPC_H
 
-
 #include <linux/interrupt.h>
 #include <linux/sysctl.h>
 #include <linux/device.h>
@@ -32,7 +30,6 @@
 #endif
 #include "xp.h"
 
-
 /*
  * XPC Version numbers consist of a major and minor number. XPC can always
  * talk to versions with same major #, and never talk to versions with a
@@ -42,7 +39,6 @@
 #define XPC_VERSION_MAJOR(_v)		((_v) >> 4)
 #define XPC_VERSION_MINOR(_v)		((_v) & 0xf)
 
-
 /*
  * The next macros define word or bit representations for given
  * C-brick nasid in either the SAL provided bit array representing
@@ -66,7 +62,6 @@
 /* define the process name of the discovery thread */
 #define XPC_DISCOVERY_THREAD_NAME	"xpc_discovery"
 
-
 /*
  * the reserved page
  *
@@ -120,7 +115,7 @@ struct xpc_rsvd_page {
 	u64 SAL_nasids_size;	/* SAL: size of each nasid mask in bytes */
 };
 
-#define XPC_RP_VERSION _XPC_VERSION(2,0) /* version 2.0 of the reserved page */
+#define XPC_RP_VERSION _XPC_VERSION(2,0)	/* version 2.0 of the reserved page */
 
 #define XPC_SUPPORTS_RP_STAMP(_version) \
 			(_version >= _XPC_VERSION(1,1))
@@ -137,14 +132,12 @@ xpc_compare_stamps(struct timespec *stam
 {
 	int ret;
 
-
 	if ((ret = stamp1->tv_sec - stamp2->tv_sec) == 0) {
 		ret = stamp1->tv_nsec - stamp2->tv_nsec;
 	}
 	return ret;
 }
 
-
 /*
  * Define the structures by which XPC variables can be exported to other
  * partitions. (There are two: struct xpc_vars and struct xpc_vars_part)
@@ -173,12 +166,11 @@ struct xpc_vars {
 	u64 heartbeating_to_mask[BITS_TO_LONGS(XP_MAX_NPARTITIONS)];
 };
 
-#define XPC_V_VERSION _XPC_VERSION(4,0) /* version 4.0 of the cross vars */
+#define XPC_V_VERSION _XPC_VERSION(4,0)	/* version 4.0 of the cross vars */
 
 #define XPC_SUPPORTS_DISENGAGE_REQUEST(_version) \
 			(_version >= _XPC_VERSION(3,1))
 
-
 static inline int
 xpc_hb_allowed(short partid, struct xpc_vars *vars)
 {
@@ -214,7 +206,6 @@ xpc_disallow_all_hbs(struct xpc_vars *va
 		vars->heartbeating_to_mask[i] = 0;
 }
 
-
 /*
  * The AMOs page(s) consists of a number of AMO variables which are divided into
  * four groups, The first group consists of one AMO per partition, each of which
@@ -254,7 +245,7 @@ static inline int
 xpc_disengage_request_amos(int npartitions)
 {
 	return xpc_engaged_partitions_amos(npartitions) +
-					xp_partid_mask_words(npartitions);
+	    xp_partid_mask_words(npartitions);
 }
 
 /* get total number of AMOs */
@@ -262,10 +253,9 @@ static inline int
 xpc_number_of_amos(int npartitions)
 {
 	return xpc_disengage_request_amos(npartitions) +
-					xp_partid_mask_words(npartitions);
+	    xp_partid_mask_words(npartitions);
 }
 
-
 /*
  * The following structure describes the per partition specific variables.
  *
@@ -300,9 +290,8 @@ struct xpc_vars_part {
  * MAGIC2 indicates that this partition has pulled the remote partititions
  * per partition variables that pertain to this partition.
  */
-#define XPC_VP_MAGIC1	0x0053524156435058L  /* 'XPCVARS\0'L (little endian) */
-#define XPC_VP_MAGIC2	0x0073726176435058L  /* 'XPCvars\0'L (little endian) */
-
+#define XPC_VP_MAGIC1	0x0053524156435058L	/* 'XPCVARS\0'L (little endian) */
+#define XPC_VP_MAGIC2	0x0073726176435058L	/* 'XPCvars\0'L (little endian) */
 
 /* the reserved page sizes and offsets */
 
@@ -316,7 +305,6 @@ struct xpc_vars_part {
 				 xp_nasid_mask_words())
 #define XPC_RP_VARS_PART(_rp)	(struct xpc_vars_part *)((u8 *)XPC_RP_VARS(_rp) + XPC_RP_VARS_SIZE)
 
-
 /*
  * Functions registered by add_timer() or called by kernel_thread() only
  * allow for a single 64-bit argument. The following macros can be used to
@@ -330,8 +318,6 @@ struct xpc_vars_part {
 #define XPC_UNPACK_ARG1(_args)	(((u64) _args) & 0xffffffff)
 #define XPC_UNPACK_ARG2(_args)	((((u64) _args) >> 32) & 0xffffffff)
 
-
-
 /*
  * Define a Get/Put value pair (pointers) used with a message queue.
  */
@@ -343,8 +329,6 @@ struct xpc_gp {
 #define XPC_GP_SIZE \
 		L1_CACHE_ALIGN(sizeof(struct xpc_gp) * XPC_NCHANNELS)
 
-
-
 /*
  * Define a structure that contains arguments associated with opening and
  * closing a channel.
@@ -360,20 +344,15 @@ struct xpc_openclose_args {
 #define XPC_OPENCLOSE_ARGS_SIZE \
 	      L1_CACHE_ALIGN(sizeof(struct xpc_openclose_args) * XPC_NCHANNELS)
 
-
-
 /* struct xpc_msg flags */
 
 #define	XPC_M_DONE		0x01	/* msg has been received/consumed */
 #define	XPC_M_READY		0x02	/* msg is ready to be sent */
 #define	XPC_M_INTERRUPT		0x04	/* send interrupt when msg consumed */
 
-
 #define XPC_MSG_ADDRESS(_payload) \
 		((struct xpc_msg *)((u8 *)(_payload) - XPC_MSG_PAYLOAD_OFFSET))
 
-
-
 /*
  * Defines notify entry.
  *
@@ -381,19 +360,17 @@ struct xpc_openclose_args {
  * and consumed by the intended recipient.
  */
 struct xpc_notify {
-	volatile u8 type;		/* type of notification */
+	volatile u8 type;	/* type of notification */
 
 	/* the following two fields are only used if type == XPC_N_CALL */
-	xpc_notify_func func;		/* user's notify function */
-	void *key;			/* pointer to user's key */
+	xpc_notify_func func;	/* user's notify function */
+	void *key;		/* pointer to user's key */
 };
 
 /* struct xpc_notify type of notification */
 
 #define	XPC_N_CALL		0x01	/* notify function provided by user */
 
-
-
 /*
  * Define the structure that manages all the stuff required by a channel. In
  * particular, they are used to manage the messages sent across the channel.
@@ -473,48 +450,48 @@ struct xpc_notify {
  *	messages.
  */
 struct xpc_channel {
-	short partid;			/* ID of remote partition connected */
-	spinlock_t lock;		/* lock for updating this structure */
-	u32 flags;			/* general flags */
-
-	enum xp_retval reason;		/* reason why channel is disconnect'g */
-	int reason_line;		/* line# disconnect initiated from */
-
-	u16 number;			/* channel # */
-
-	u16 msg_size;			/* sizeof each msg entry */
-	u16 local_nentries;		/* #of msg entries in local msg queue */
-	u16 remote_nentries;		/* #of msg entries in remote msg queue*/
+	short partid;		/* ID of remote partition connected */
+	spinlock_t lock;	/* lock for updating this structure */
+	u32 flags;		/* general flags */
+
+	enum xp_retval reason;	/* reason why channel is disconnect'g */
+	int reason_line;	/* line# disconnect initiated from */
+
+	u16 number;		/* channel # */
+
+	u16 msg_size;		/* sizeof each msg entry */
+	u16 local_nentries;	/* #of msg entries in local msg queue */
+	u16 remote_nentries;	/* #of msg entries in remote msg queue */
 
 	void *local_msgqueue_base;	/* base address of kmalloc'd space */
 	struct xpc_msg *local_msgqueue;	/* local message queue */
 	void *remote_msgqueue_base;	/* base address of kmalloc'd space */
-	struct xpc_msg *remote_msgqueue;/* cached copy of remote partition's */
-					/* local message queue */
-	u64 remote_msgqueue_pa;		/* phys addr of remote partition's */
-					/* local message queue */
+	struct xpc_msg *remote_msgqueue;	/* cached copy of remote partition's */
+	/* local message queue */
+	u64 remote_msgqueue_pa;	/* phys addr of remote partition's */
+	/* local message queue */
 
-	atomic_t references;		/* #of external references to queues */
+	atomic_t references;	/* #of external references to queues */
 
-	atomic_t n_on_msg_allocate_wq;   /* #on msg allocation wait queue */
-	wait_queue_head_t msg_allocate_wq; /* msg allocation wait queue */
+	atomic_t n_on_msg_allocate_wq;	/* #on msg allocation wait queue */
+	wait_queue_head_t msg_allocate_wq;	/* msg allocation wait queue */
 
-	u8 delayed_IPI_flags;		/* IPI flags received, but delayed */
-					/* action until channel disconnected */
+	u8 delayed_IPI_flags;	/* IPI flags received, but delayed */
+	/* action until channel disconnected */
 
 	/* queue of msg senders who want to be notified when msg received */
 
-	atomic_t n_to_notify;		/* #of msg senders to notify */
-	struct xpc_notify *notify_queue;/* notify queue for messages sent */
+	atomic_t n_to_notify;	/* #of msg senders to notify */
+	struct xpc_notify *notify_queue;	/* notify queue for messages sent */
 
-	xpc_channel_func func;		/* user's channel function */
-	void *key;			/* pointer to user's key */
+	xpc_channel_func func;	/* user's channel function */
+	void *key;		/* pointer to user's key */
 
 	struct mutex msg_to_pull_mutex;	/* next msg to pull serialization */
-	struct completion wdisconnect_wait; /* wait for channel disconnect */
+	struct completion wdisconnect_wait;	/* wait for channel disconnect */
 
-	struct xpc_openclose_args *local_openclose_args; /* args passed on */
-					/* opening or closing of channel */
+	struct xpc_openclose_args *local_openclose_args;	/* args passed on */
+	/* opening or closing of channel */
 
 	/* various flavors of local and remote Get/Put values */
 
@@ -522,13 +499,13 @@ struct xpc_channel {
 	struct xpc_gp remote_GP;	/* remote Get/Put values */
 	struct xpc_gp w_local_GP;	/* working local Get/Put values */
 	struct xpc_gp w_remote_GP;	/* working remote Get/Put values */
-	s64 next_msg_to_pull;		/* Put value of next msg to pull */
+	s64 next_msg_to_pull;	/* Put value of next msg to pull */
 
 	/* kthread management related fields */
 
 	atomic_t kthreads_assigned;	/* #of kthreads assigned to channel */
 	u32 kthreads_assigned_limit;	/* limit on #of kthreads assigned */
-	atomic_t kthreads_idle;		/* #of kthreads idle waiting for work */
+	atomic_t kthreads_idle;	/* #of kthreads idle waiting for work */
 	u32 kthreads_idle_limit;	/* limit on #of kthreads idle */
 	atomic_t kthreads_active;	/* #of kthreads actively working */
 
@@ -536,37 +513,34 @@ struct xpc_channel {
 
 } ____cacheline_aligned;
 
-
 /* struct xpc_channel flags */
 
-#define	XPC_C_WASCONNECTED	0x00000001 /* channel was connected */
+#define	XPC_C_WASCONNECTED	0x00000001	/* channel was connected */
 
-#define	XPC_C_ROPENREPLY	0x00000002 /* remote open channel reply */
-#define	XPC_C_OPENREPLY		0x00000004 /* local open channel reply */
-#define	XPC_C_ROPENREQUEST	0x00000008 /* remote open channel request */
-#define	XPC_C_OPENREQUEST	0x00000010 /* local open channel request */
+#define	XPC_C_ROPENREPLY	0x00000002	/* remote open channel reply */
+#define	XPC_C_OPENREPLY		0x00000004	/* local open channel reply */
+#define	XPC_C_ROPENREQUEST	0x00000008	/* remote open channel request */
+#define	XPC_C_OPENREQUEST	0x00000010	/* local open channel request */
 
-#define	XPC_C_SETUP		0x00000020 /* channel's msgqueues are alloc'd */
-#define	XPC_C_CONNECTEDCALLOUT	0x00000040 /* connected callout initiated */
+#define	XPC_C_SETUP		0x00000020	/* channel's msgqueues are alloc'd */
+#define	XPC_C_CONNECTEDCALLOUT	0x00000040	/* connected callout initiated */
 #define	XPC_C_CONNECTEDCALLOUT_MADE \
-				0x00000080 /* connected callout completed */
-#define	XPC_C_CONNECTED		0x00000100 /* local channel is connected */
-#define	XPC_C_CONNECTING	0x00000200 /* channel is being connected */
-
-#define	XPC_C_RCLOSEREPLY	0x00000400 /* remote close channel reply */
-#define	XPC_C_CLOSEREPLY	0x00000800 /* local close channel reply */
-#define	XPC_C_RCLOSEREQUEST	0x00001000 /* remote close channel request */
-#define	XPC_C_CLOSEREQUEST	0x00002000 /* local close channel request */
+				0x00000080	/* connected callout completed */
+#define	XPC_C_CONNECTED		0x00000100	/* local channel is connected */
+#define	XPC_C_CONNECTING	0x00000200	/* channel is being connected */
+
+#define	XPC_C_RCLOSEREPLY	0x00000400	/* remote close channel reply */
+#define	XPC_C_CLOSEREPLY	0x00000800	/* local close channel reply */
+#define	XPC_C_RCLOSEREQUEST	0x00001000	/* remote close channel request */
+#define	XPC_C_CLOSEREQUEST	0x00002000	/* local close channel request */
 
-#define	XPC_C_DISCONNECTED	0x00004000 /* channel is disconnected */
-#define	XPC_C_DISCONNECTING	0x00008000 /* channel is being disconnected */
+#define	XPC_C_DISCONNECTED	0x00004000	/* channel is disconnected */
+#define	XPC_C_DISCONNECTING	0x00008000	/* channel is being disconnected */
 #define	XPC_C_DISCONNECTINGCALLOUT \
-				0x00010000 /* disconnecting callout initiated */
+				0x00010000	/* disconnecting callout initiated */
 #define	XPC_C_DISCONNECTINGCALLOUT_MADE \
-				0x00020000 /* disconnecting callout completed */
-#define	XPC_C_WDISCONNECT	0x00040000 /* waiting for channel disconnect */
-
-
+				0x00020000	/* disconnecting callout completed */
+#define	XPC_C_WDISCONNECT	0x00040000	/* waiting for channel disconnect */
 
 /*
  * Manages channels on a partition basis. There is one of these structures
@@ -577,36 +551,34 @@ struct xpc_partition {
 
 	/* XPC HB infrastructure */
 
-	u8 remote_rp_version;		/* version# of partition's rsvd pg */
+	u8 remote_rp_version;	/* version# of partition's rsvd pg */
 	short remote_npartitions;	/* value of XPC_NPARTITIONS */
-	u32 flags;			/* general flags */
-	struct timespec remote_rp_stamp;/* time when rsvd pg was initialized */
-	u64 remote_rp_pa;		/* phys addr of partition's rsvd pg */
-	u64 remote_vars_pa;		/* phys addr of partition's vars */
+	u32 flags;		/* general flags */
+	struct timespec remote_rp_stamp;	/* time when rsvd pg was initialized */
+	u64 remote_rp_pa;	/* phys addr of partition's rsvd pg */
+	u64 remote_vars_pa;	/* phys addr of partition's vars */
 	u64 remote_vars_part_pa;	/* phys addr of partition's vars part */
-	u64 last_heartbeat;		/* HB at last read */
+	u64 last_heartbeat;	/* HB at last read */
 	u64 remote_amos_page_pa;	/* phys addr of partition's amos page */
-	int remote_act_nasid;		/* active part's act/deact nasid */
+	int remote_act_nasid;	/* active part's act/deact nasid */
 	int remote_act_phys_cpuid;	/* active part's act/deact phys cpuid */
-	u32 act_IRQ_rcvd;		/* IRQs since activation */
-	spinlock_t lock;		/* protect updating of act_state and */
-					/* the general flags */
-	u8 act_state;			/* from XPC HB viewpoint */
-	u8 remote_vars_version;		/* version# of partition's vars */
-	enum xp_retval reason;		/* reason partition is deactivating */
-	int reason_line;		/* line# deactivation initiated from */
-	int reactivate_nasid;		/* nasid in partition to reactivate */
+	u32 act_IRQ_rcvd;	/* IRQs since activation */
+	spinlock_t lock;	/* protect updating of act_state and */
+	/* the general flags */
+	u8 act_state;		/* from XPC HB viewpoint */
+	u8 remote_vars_version;	/* version# of partition's vars */
+	enum xp_retval reason;	/* reason partition is deactivating */
+	int reason_line;	/* line# deactivation initiated from */
+	int reactivate_nasid;	/* nasid in partition to reactivate */
 
-	unsigned long disengage_request_timeout; /* timeout in jiffies */
+	unsigned long disengage_request_timeout;	/* timeout in jiffies */
 	struct timer_list disengage_request_timer;
 
-
 	/* XPC infrastructure referencing and teardown control */
 
 	volatile u8 setup_state;	/* infrastructure setup state */
 	wait_queue_head_t teardown_wq;	/* kthread waiting to teardown infra */
-	atomic_t references;		/* #of references to infrastructure */
-
+	atomic_t references;	/* #of references to infrastructure */
 
 	/*
 	 * NONE OF THE PRECEDING FIELDS OF THIS STRUCTURE WILL BE CLEARED WHEN
@@ -615,55 +587,51 @@ struct xpc_partition {
 	 * 'nchannels' FIELD MUST BE THE FIRST OF THE FIELDS TO BE CLEARED.)
 	 */
 
-
-	u8 nchannels;		   /* #of defined channels supported */
-	atomic_t nchannels_active; /* #of channels that are not DISCONNECTED */
-	atomic_t nchannels_engaged;/* #of channels engaged with remote part */
-	struct xpc_channel *channels;/* array of channel structures */
-
-	void *local_GPs_base;	  /* base address of kmalloc'd space */
-	struct xpc_gp *local_GPs; /* local Get/Put values */
-	void *remote_GPs_base;    /* base address of kmalloc'd space */
-	struct xpc_gp *remote_GPs;/* copy of remote partition's local Get/Put */
-				  /* values */
-	u64 remote_GPs_pa;	  /* phys address of remote partition's local */
-				  /* Get/Put values */
-
+	u8 nchannels;		/* #of defined channels supported */
+	atomic_t nchannels_active;	/* #of channels that are not DISCONNECTED */
+	atomic_t nchannels_engaged;	/* #of channels engaged with remote part */
+	struct xpc_channel *channels;	/* array of channel structures */
+
+	void *local_GPs_base;	/* base address of kmalloc'd space */
+	struct xpc_gp *local_GPs;	/* local Get/Put values */
+	void *remote_GPs_base;	/* base address of kmalloc'd space */
+	struct xpc_gp *remote_GPs;	/* copy of remote partition's local Get/Put */
+	/* values */
+	u64 remote_GPs_pa;	/* phys address of remote partition's local */
+	/* Get/Put values */
 
 	/* fields used to pass args when opening or closing a channel */
 
-	void *local_openclose_args_base;  /* base address of kmalloc'd space */
-	struct xpc_openclose_args *local_openclose_args;  /* local's args */
-	void *remote_openclose_args_base; /* base address of kmalloc'd space */
-	struct xpc_openclose_args *remote_openclose_args; /* copy of remote's */
-					  /* args */
-	u64 remote_openclose_args_pa;	  /* phys addr of remote's args */
-
+	void *local_openclose_args_base;	/* base address of kmalloc'd space */
+	struct xpc_openclose_args *local_openclose_args;	/* local's args */
+	void *remote_openclose_args_base;	/* base address of kmalloc'd space */
+	struct xpc_openclose_args *remote_openclose_args;	/* copy of remote's */
+	/* args */
+	u64 remote_openclose_args_pa;	/* phys addr of remote's args */
 
 	/* IPI sending, receiving and handling related fields */
 
-	int remote_IPI_nasid;	    /* nasid of where to send IPIs */
-	int remote_IPI_phys_cpuid;  /* phys CPU ID of where to send IPIs */
-	u64 *remote_IPI_amo_va;	    /* address of remote IPI AMO variable */
-
-	u64 *local_IPI_amo_va;      /* address of IPI AMO variable */
-	u64 local_IPI_amo;	    /* IPI amo flags yet to be handled */
-	char IPI_owner[8];	    /* IPI owner's name */
-	struct timer_list dropped_IPI_timer; /* dropped IPI timer */
-
-	spinlock_t IPI_lock;	    /* IPI handler lock */
+	int remote_IPI_nasid;	/* nasid of where to send IPIs */
+	int remote_IPI_phys_cpuid;	/* phys CPU ID of where to send IPIs */
+	u64 *remote_IPI_amo_va;	/* address of remote IPI AMO variable */
+
+	u64 *local_IPI_amo_va;	/* address of IPI AMO variable */
+	u64 local_IPI_amo;	/* IPI amo flags yet to be handled */
+	char IPI_owner[8];	/* IPI owner's name */
+	struct timer_list dropped_IPI_timer;	/* dropped IPI timer */
 
+	spinlock_t IPI_lock;	/* IPI handler lock */
 
 	/* channel manager related fields */
 
 	atomic_t channel_mgr_requests;	/* #of requests to activate chan mgr */
-	wait_queue_head_t channel_mgr_wq; /* channel mgr's wait queue */
+	wait_queue_head_t channel_mgr_wq;	/* channel mgr's wait queue */
 
 } ____cacheline_aligned;
 
 /* struct xpc_partition flags */
 
-#define	XPC_P_RAMOSREGISTERED	0x00000001 /* remote AMOs were registered */
+#define	XPC_P_RAMOSREGISTERED	0x00000001	/* remote AMOs were registered */
 
 /* struct xpc_partition act_state values (for XPC HB) */
 
@@ -673,11 +641,9 @@ struct xpc_partition {
 #define XPC_P_AS_ACTIVE		0x03	/* xpc_partition_up() was called */
 #define XPC_P_AS_DEACTIVATING	0x04	/* partition deactivation initiated */
 
-
 #define XPC_DEACTIVATE_PARTITION(_p, _reason) \
 			xpc_deactivate_partition(__LINE__, (_p), (_reason))
 
-
 /* struct xpc_partition setup_state values */
 
 #define XPC_P_SS_UNSET		0x00	/* infrastructure was never setup */
@@ -685,8 +651,6 @@ struct xpc_partition {
 #define XPC_P_SS_WTEARDOWN	0x02	/* waiting to teardown infrastructure */
 #define XPC_P_SS_TORNDOWN	0x03	/* infrastructure is torndown */
 
-
-
 /*
  * struct xpc_partition IPI_timer #of seconds to wait before checking for
  * dropped IPIs. These occur whenever an IPI amo write doesn't complete until
@@ -694,22 +658,17 @@ struct xpc_partition {
  */
 #define XPC_DROPPED_IPI_WAIT_INTERVAL	(0.25 * HZ)
 
-
 /* number of seconds to wait for other partitions to disengage */
 #define XPC_DISENGAGE_REQUEST_DEFAULT_TIMELIMIT	90
 
 /* interval in seconds to print 'waiting disengagement' messages */
 #define XPC_DISENGAGE_PRINTMSG_INTERVAL		10
 
-
 #define XPC_PARTID(_p)	((short) ((_p) - &xpc_partitions[0]))
 
-
-
 /* found in xp_main.c */
 extern struct xpc_registration xpc_registrations[];
 
-
 /* found in xpc_main.c */
 extern struct device *xpc_part;
 extern struct device *xpc_chan;
@@ -722,7 +681,6 @@ extern void xpc_activate_kthreads(struct
 extern void xpc_create_kthreads(struct xpc_channel *, int, int);
 extern void xpc_disconnect_wait(int);
 
-
 /* found in xpc_partition.c */
 extern int xpc_exiting;
 extern struct xpc_vars *xpc_vars;
@@ -737,7 +695,7 @@ extern int xpc_identify_act_IRQ_sender(v
 extern int xpc_partition_disengaged(struct xpc_partition *);
 extern enum xp_retval xpc_mark_partition_active(struct xpc_partition *);
 extern void xpc_deactivate_partition(const int, struct xpc_partition *,
-						enum xp_retval);
+				     enum xp_retval);
 extern void xpc_mark_partition_inactive(struct xpc_partition *);
 extern enum xp_retval xpc_register_remote_amos(struct xpc_partition *);
 extern void xpc_unregister_remote_amos(struct xpc_partition *);
@@ -745,14 +703,13 @@ extern void xpc_discovery(void);
 extern void xpc_check_remote_hb(void);
 extern enum xp_retval xpc_initiate_partid_to_nasids(short, void *);
 
-
 /* found in xpc_channel.c */
 extern void xpc_initiate_connect(int);
 extern void xpc_initiate_disconnect(int);
 extern enum xp_retval xpc_initiate_allocate(short, int, u32, void **);
 extern enum xp_retval xpc_initiate_send(short, int, void *);
 extern enum xp_retval xpc_initiate_send_notify(short, int, void *,
-						xpc_notify_func, void *);
+					       xpc_notify_func, void *);
 extern void xpc_initiate_received(short, int, void *);
 extern enum xp_retval xpc_setup_infrastructure(struct xpc_partition *);
 extern enum xp_retval xpc_pull_remote_vars_part(struct xpc_partition *);
@@ -760,13 +717,11 @@ extern void xpc_process_channel_activity
 extern void xpc_connected_callout(struct xpc_channel *);
 extern void xpc_deliver_msg(struct xpc_channel *);
 extern void xpc_disconnect_channel(const int, struct xpc_channel *,
-					enum xp_retval, unsigned long *);
+				   enum xp_retval, unsigned long *);
 extern void xpc_disconnect_callout(struct xpc_channel *, enum xp_retval);
 extern void xpc_partition_going_down(struct xpc_partition *, enum xp_retval);
 extern void xpc_teardown_infrastructure(struct xpc_partition *);
 
-
-
 static inline void
 xpc_wakeup_channel_mgr(struct xpc_partition *part)
 {
@@ -775,8 +730,6 @@ xpc_wakeup_channel_mgr(struct xpc_partit
 	}
 }
 
-
-
 /*
  * These next two inlines are used to keep us from tearing down a channel's
  * msg queues while a thread may be referencing them.
@@ -798,12 +751,9 @@ xpc_msgqueue_deref(struct xpc_channel *c
 	}
 }
 
-
-
 #define XPC_DISCONNECT_CHANNEL(_ch, _reason, _irqflgs) \
 		xpc_disconnect_channel(__LINE__, _ch, _reason, _irqflgs)
 
-
 /*
  * These two inlines are used to keep us from tearing down a partition's
  * setup infrastructure while a thread may be referencing it.
@@ -813,7 +763,6 @@ xpc_part_deref(struct xpc_partition *par
 {
 	s32 refs = atomic_dec_return(&part->references);
 
-
 	DBUG_ON(refs < 0);
 	if (refs == 0 && part->setup_state == XPC_P_SS_WTEARDOWN) {
 		wake_up(&part->teardown_wq);
@@ -825,7 +774,6 @@ xpc_part_ref(struct xpc_partition *part)
 {
 	int setup;
 
-
 	atomic_inc(&part->references);
 	setup = (part->setup_state == XPC_P_SS_SETUP);
 	if (!setup) {
@@ -834,8 +782,6 @@ xpc_part_ref(struct xpc_partition *part)
 	return setup;
 }
 
-
-
 /*
  * The following macro is to be used for the setting of the reason and
  * reason_line fields in both the struct xpc_channel and struct xpc_partition
@@ -847,8 +793,6 @@ xpc_part_ref(struct xpc_partition *part)
 		(_p)->reason_line = _line; \
 	}
 
-
-
 /*
  * This next set of inlines are used to keep track of when a partition is
  * potentially engaged in accessing memory belonging to another partition.
@@ -858,8 +802,9 @@ static inline void
 xpc_mark_partition_engaged(struct xpc_partition *part)
 {
 	u64 *amo_va = __va(part->remote_amos_page_pa +
-			(xpc_engaged_partitions_amos(part->remote_npartitions) +
-			BIT_WORD(xp_partition_id)) * xp_sizeof_amo);
+			   (xpc_engaged_partitions_amos
+			    (part->remote_npartitions) +
+			    BIT_WORD(xp_partition_id)) * xp_sizeof_amo);
 
 	/* set bit corresponding to our partid in remote partition's AMO */
 	(void)xp_set_amo(amo_va, XP_AMO_OR, BIT_MASK(xp_partition_id), 1);
@@ -869,8 +814,9 @@ static inline void
 xpc_mark_partition_disengaged(struct xpc_partition *part)
 {
 	u64 *amo_va = __va(part->remote_amos_page_pa +
-			(xpc_engaged_partitions_amos(part->remote_npartitions) +
-			BIT_WORD(xp_partition_id)) * xp_sizeof_amo);
+			   (xpc_engaged_partitions_amos
+			    (part->remote_npartitions) +
+			    BIT_WORD(xp_partition_id)) * xp_sizeof_amo);
 
 	/* clear bit corresponding to our partid in remote partition's AMO */
 	(void)xp_set_amo(amo_va, XP_AMO_AND, ~BIT_MASK(xp_partition_id), 1);
@@ -880,8 +826,8 @@ static inline void
 xpc_request_partition_disengage(struct xpc_partition *part)
 {
 	u64 *amo_va = __va(part->remote_amos_page_pa +
-			(xpc_disengage_request_amos(part->remote_npartitions) +
-			BIT_WORD(xp_partition_id)) * xp_sizeof_amo);
+			   (xpc_disengage_request_amos(part->remote_npartitions)
+			    + BIT_WORD(xp_partition_id)) * xp_sizeof_amo);
 
 	/* set bit corresponding to our partid in remote partition's AMO */
 	(void)xp_set_amo(amo_va, XP_AMO_OR, BIT_MASK(xp_partition_id), 1);
@@ -891,8 +837,8 @@ static inline void
 xpc_cancel_partition_disengage_request(struct xpc_partition *part)
 {
 	u64 *amo_va = __va(part->remote_amos_page_pa +
-			(xpc_disengage_request_amos(part->remote_npartitions) +
-			BIT_WORD(xp_partition_id)) * xp_sizeof_amo);
+			   (xpc_disengage_request_amos(part->remote_npartitions)
+			    + BIT_WORD(xp_partition_id)) * xp_sizeof_amo);
 
 	/* clear bit corresponding to our partid in remote partition's AMO */
 	(void)xp_set_amo(amo_va, XP_AMO_AND, ~BIT_MASK(xp_partition_id), 1);
@@ -904,14 +850,15 @@ xpc_any_partition_engaged(void)
 	enum xp_retval ret;
 	int w_index;
 	u64 *amo_va = (u64 *)((u64)xpc_vars->amos_page +
-			xpc_engaged_partitions_amos(xpc_vars->npartitions) *
-			xp_sizeof_amo);
+			      xpc_engaged_partitions_amos(xpc_vars->
+							  npartitions) *
+			      xp_sizeof_amo);
 	u64 amo;
 
 	for (w_index = 0; w_index < xp_partid_mask_words(xpc_vars->npartitions);
 	     w_index++) {
 		ret = xp_get_amo(amo_va, XP_AMO_LOAD, &amo);
-		BUG_ON(ret != xpSuccess);  /* should never happen */
+		BUG_ON(ret != xpSuccess);	/* should never happen */
 		if (amo != 0)
 			return 1;
 
@@ -925,13 +872,14 @@ xpc_partition_engaged(short partid)
 {
 	enum xp_retval ret;
 	u64 *amo_va = (u64 *)((u64)xpc_vars->amos_page +
-			(xpc_engaged_partitions_amos(xpc_vars->npartitions) +
-			BIT_WORD(partid)) * xp_sizeof_amo);
+			      (xpc_engaged_partitions_amos
+			       (xpc_vars->npartitions) +
+			       BIT_WORD(partid)) * xp_sizeof_amo);
 	u64 amo;
 
 	/* return our partition's AMO variable ANDed with partid mask */
 	ret = xp_get_amo(amo_va, XP_AMO_LOAD, &amo);
-	BUG_ON(ret != xpSuccess);  /* should never happen */
+	BUG_ON(ret != xpSuccess);	/* should never happen */
 	return (amo & BIT_MASK(partid));
 }
 
@@ -940,13 +888,14 @@ xpc_partition_disengage_requested(short 
 {
 	enum xp_retval ret;
 	u64 *amo_va = (u64 *)((u64)xpc_vars->amos_page +
-			(xpc_disengage_request_amos(xpc_vars->npartitions) +
-			BIT_WORD(partid)) * xp_sizeof_amo);
+			      (xpc_disengage_request_amos
+			       (xpc_vars->npartitions) +
+			       BIT_WORD(partid)) * xp_sizeof_amo);
 	u64 amo;
 
 	/* return our partition's AMO variable ANDed with partid mask */
 	ret = xp_get_amo(amo_va, XP_AMO_LOAD, &amo);
-	BUG_ON(ret != xpSuccess);  /* should never happen */
+	BUG_ON(ret != xpSuccess);	/* should never happen */
 	return (amo & BIT_MASK(partid));
 }
 
@@ -955,12 +904,13 @@ xpc_clear_partition_engaged(short partid
 {
 	enum xp_retval ret;
 	u64 *amo_va = (u64 *)((u64)xpc_vars->amos_page +
-			(xpc_engaged_partitions_amos(xpc_vars->npartitions) +
-			BIT_WORD(partid)) * xp_sizeof_amo);
+			      (xpc_engaged_partitions_amos
+			       (xpc_vars->npartitions) +
+			       BIT_WORD(partid)) * xp_sizeof_amo);
 
 	/* clear bit corresponding to partid in our partition's AMO */
 	ret = xp_set_amo(amo_va, XP_AMO_AND, ~BIT_MASK(partid), 0);
-	BUG_ON(ret != xpSuccess);  /* should never happen */
+	BUG_ON(ret != xpSuccess);	/* should never happen */
 }
 
 static inline void
@@ -968,16 +918,15 @@ xpc_clear_partition_disengage_request(sh
 {
 	enum xp_retval ret;
 	u64 *amo_va = (u64 *)((u64)xpc_vars->amos_page +
-			(xpc_disengage_request_amos(xpc_vars->npartitions) +
-			BIT_WORD(partid)) * xp_sizeof_amo);
+			      (xpc_disengage_request_amos
+			       (xpc_vars->npartitions) +
+			       BIT_WORD(partid)) * xp_sizeof_amo);
 
 	/* clear bit corresponding to partid in our partition's AMO */
 	ret = xp_set_amo(amo_va, XP_AMO_AND, ~BIT_MASK(partid), 0);
-	BUG_ON(ret != xpSuccess);  /* should never happen */
+	BUG_ON(ret != xpSuccess);	/* should never happen */
 }
 
-
-
 /*
  * The following set of macros and inlines are used for the sending and
  * receiving of IPIs (also known as IRQs). There are two flavors of IPIs,
@@ -1000,13 +949,13 @@ xpc_activate_IRQ_send(u64 amos_page_pa, 
 	/* SN nodes are always even numbered nasids */
 	u64 *amo_va = (u64 *)__va(amos_page_pa +
 				  (xpc_activate_irq_amos(npartitions) +
-				  BIT_WORD(from_nasid/2)) * xp_sizeof_amo);
+				   BIT_WORD(from_nasid / 2)) * xp_sizeof_amo);
 
 	ret = xp_set_amo_with_interrupt(amo_va, XP_AMO_OR,
-					BIT_MASK(from_nasid/2),
+					BIT_MASK(from_nasid / 2),
 					remote_amo, to_nasid,
 					to_phys_cpuid, SGI_XPC_ACTIVATE);
-	BUG_ON(!remote_amo && ret != xpSuccess); /* should never happen*/
+	BUG_ON(!remote_amo && ret != xpSuccess);	/* should never happen */
 }
 
 static inline void
@@ -1043,7 +992,6 @@ xpc_IPI_send_disengage(struct xpc_partit
 			      part->remote_npartitions);
 }
 
-
 /*
  * IPIs associated with SGI_XPC_NOTIFY IRQ.
  */
@@ -1057,12 +1005,11 @@ xpc_IPI_send_disengage(struct xpc_partit
 
 static inline void
 xpc_notify_IRQ_send(struct xpc_channel *ch, u8 ipi_flag, char *ipi_flag_string,
-			unsigned long *irq_flags)
+		    unsigned long *irq_flags)
 {
 	struct xpc_partition *part = &xpc_partitions[ch->partid];
 	enum xp_retval ret;
 
-
 	if (unlikely(part->act_state == XPC_P_AS_DEACTIVATING))
 		return;
 
@@ -1082,7 +1029,6 @@ xpc_notify_IRQ_send(struct xpc_channel *
 	}
 }
 
-
 /*
  * Make it look like the remote partition, which is associated with the
  * specified channel, sent us an IPI. This faked IPI will be handled
@@ -1093,21 +1039,21 @@ xpc_notify_IRQ_send(struct xpc_channel *
 
 static inline void
 xpc_notify_IRQ_send_local(struct xpc_channel *ch, u8 ipi_flag,
-				char *ipi_flag_string)
+			  char *ipi_flag_string)
 {
 	enum xp_retval ret;
 	u64 *amo_va = xpc_partitions[ch->partid].local_IPI_amo_va;
 
 	/* set IPI flag corresponding to channel in partition's local AMO */
-	ret = xp_set_amo(amo_va, XP_AMO_OR, ((u64)ipi_flag << (ch->number * 8)),
-			 0);
-	BUG_ON(ret != xpSuccess);  /* should never happen */
+	ret =
+	    xp_set_amo(amo_va, XP_AMO_OR, ((u64)ipi_flag << (ch->number * 8)),
+		       0);
+	BUG_ON(ret != xpSuccess);	/* should never happen */
 
 	dev_dbg(xpc_chan, "%s sent local from partid=%d, channel=%d\n",
 		ipi_flag_string, ch->partid, ch->number);
 }
 
-
 /*
  * The sending and receiving of IPIs includes the setting of an AMO variable
  * to indicate the reason the IPI was sent. The 64-bit variable is divided
@@ -1122,7 +1068,6 @@ xpc_notify_IRQ_send_local(struct xpc_cha
 #define	XPC_IPI_OPENREPLY	0x08
 #define	XPC_IPI_MSGREQUEST	0x10
 
-
 /* given an AMO variable and a channel#, get its associated IPI flags */
 #define XPC_GET_IPI_FLAGS(_amo, _c)	((u8) (((_amo) >> ((_c) * 8)) & 0xff))
 #define XPC_SET_IPI_FLAGS(_amo, _c, _f)	(_amo) |= ((u64) (_f) << ((_c) * 8))
@@ -1130,13 +1075,11 @@ xpc_notify_IRQ_send_local(struct xpc_cha
 #define	XPC_ANY_OPENCLOSE_IPI_FLAGS_SET(_amo) ((_amo) & 0x0f0f0f0f0f0f0f0fUL)
 #define XPC_ANY_MSG_IPI_FLAGS_SET(_amo)       ((_amo) & 0x1010101010101010UL)
 
-
 static inline void
 xpc_IPI_send_closerequest(struct xpc_channel *ch, unsigned long *irq_flags)
 {
 	struct xpc_openclose_args *args = ch->local_openclose_args;
 
-
 	args->reason = ch->reason;
 
 	XPC_NOTIFY_IRQ_SEND(ch, XPC_IPI_CLOSEREQUEST, irq_flags);
@@ -1153,7 +1096,6 @@ xpc_IPI_send_openrequest(struct xpc_chan
 {
 	struct xpc_openclose_args *args = ch->local_openclose_args;
 
-
 	args->msg_size = ch->msg_size;
 	args->local_nentries = ch->local_nentries;
 
@@ -1165,7 +1107,6 @@ xpc_IPI_send_openreply(struct xpc_channe
 {
 	struct xpc_openclose_args *args = ch->local_openclose_args;
 
-
 	args->remote_nentries = ch->remote_nentries;
 	args->local_nentries = ch->local_nentries;
 	args->local_msgqueue_pa = __pa(ch->local_msgqueue);
@@ -1185,21 +1126,17 @@ xpc_IPI_send_local_msgrequest(struct xpc
 	XPC_NOTIFY_IRQ_SEND_LOCAL(ch, XPC_IPI_MSGREQUEST);
 }
 
-
 static inline u64 *
 xpc_IPI_init(int index)
 {
 	enum xp_retval ret;
-	u64 *amo_va = (u64 *)((u64)xpc_vars->amos_page + index *
-				xp_sizeof_amo);
+	u64 *amo_va = (u64 *)((u64)xpc_vars->amos_page + index * xp_sizeof_amo);
 
 	ret = xp_get_amo(amo_va, XP_AMO_CLEAR, NULL);
-	BUG_ON(ret != xpSuccess);  /* should never happen */
+	BUG_ON(ret != xpSuccess);	/* should never happen */
 	return amo_va;
 }
 
-
-
 /*
  * Check to see if there is any channel activity to/from the specified
  * partition.
@@ -1211,9 +1148,8 @@ xpc_check_for_channel_activity(struct xp
 	u64 IPI_amo;
 	unsigned long irq_flags;
 
-
 	ret = xp_get_amo(part->local_IPI_amo_va, XP_AMO_CLEAR, &IPI_amo);
-	BUG_ON(ret != xpSuccess);  /* should never happen */
+	BUG_ON(ret != xpSuccess);	/* should never happen */
 	if (IPI_amo == 0) {
 		return;
 	}
@@ -1228,6 +1164,4 @@ xpc_check_for_channel_activity(struct xp
 	xpc_wakeup_channel_mgr(part);
 }
 
-
 #endif /* _DRIVERS_MISC_XP_XPC_H */
-
Index: linux-2.6/drivers/misc/xp/xpc_channel.c
===================================================================
--- linux-2.6.orig/drivers/misc/xp/xpc_channel.c	2008-03-26 10:41:46.000000000 -0500
+++ linux-2.6/drivers/misc/xp/xpc_channel.c	2008-03-26 10:57:58.908017152 -0500
@@ -6,7 +6,6 @@
  * Copyright (c) 2004-2008 Silicon Graphics, Inc.  All Rights Reserved.
  */
 
-
 /*
  * Cross Partition Communication (XPC) channel support.
  *
@@ -15,7 +14,6 @@
  *
  */
 
-
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/sched.h>
@@ -29,7 +27,6 @@
 #define cmpxchg_rel(ptr,o,n)	cmpxchg(ptr,o,n)
 #endif
 
-
 /*
  * Guarantee that the kzalloc'd memory is cacheline aligned.
  */
@@ -41,7 +38,7 @@ xpc_kzalloc_cacheline_aligned(size_t siz
 	if (*base == NULL) {
 		return NULL;
 	}
-	if ((u64) *base == L1_CACHE_ALIGN((u64) *base)) {
+	if ((u64)*base == L1_CACHE_ALIGN((u64)*base)) {
 		return *base;
 	}
 	kfree(*base);
@@ -51,10 +48,9 @@ xpc_kzalloc_cacheline_aligned(size_t siz
 	if (*base == NULL) {
 		return NULL;
 	}
-	return (void *) L1_CACHE_ALIGN((u64) *base);
+	return (void *)L1_CACHE_ALIGN((u64)*base);
 }
 
-
 /*
  * Set up the initial values for the XPartition Communication channels.
  */
@@ -64,7 +60,6 @@ xpc_initialize_channels(struct xpc_parti
 	int ch_number;
 	struct xpc_channel *ch;
 
-
 	for (ch_number = 0; ch_number < part->nchannels; ch_number++) {
 		ch = &part->channels[ch_number];
 
@@ -74,7 +69,7 @@ xpc_initialize_channels(struct xpc_parti
 
 		ch->local_GP = &part->local_GPs[ch_number];
 		ch->local_openclose_args =
-					&part->local_openclose_args[ch_number];
+		    &part->local_openclose_args[ch_number];
 
 		atomic_set(&ch->kthreads_assigned, 0);
 		atomic_set(&ch->kthreads_idle, 0);
@@ -93,7 +88,6 @@ xpc_initialize_channels(struct xpc_parti
 	}
 }
 
-
 /*
  * Setup the infrastructure necessary to support XPartition Communication
  * between the specified remote partition and the local one.
@@ -105,7 +99,6 @@ xpc_setup_infrastructure(struct xpc_part
 	struct timer_list *timer;
 	short partid = XPC_PARTID(part);
 
-
 	/*
 	 * Zero out MOST of the entry for this partition. Only the fields
 	 * starting with `nchannels' will be zeroed. The preceding fields must
@@ -113,14 +106,14 @@ xpc_setup_infrastructure(struct xpc_part
 	 * referenced during this memset() operation.
 	 */
 	memset(&part->nchannels, 0, sizeof(struct xpc_partition) -
-				offsetof(struct xpc_partition, nchannels));
+	       offsetof(struct xpc_partition, nchannels));
 
 	/*
 	 * Allocate all of the channel structures as a contiguous chunk of
 	 * memory.
 	 */
 	part->channels = kzalloc(sizeof(struct xpc_channel) * XPC_NCHANNELS,
-								GFP_KERNEL);
+				 GFP_KERNEL);
 	if (part->channels == NULL) {
 		dev_err(xpc_chan, "can't get memory for channels\n");
 		return xpNoMemory;
@@ -128,11 +121,11 @@ xpc_setup_infrastructure(struct xpc_part
 
 	part->nchannels = XPC_NCHANNELS;
 
-
 	/* allocate all the required GET/PUT values */
 
 	part->local_GPs = xpc_kzalloc_cacheline_aligned(XPC_GP_SIZE,
-					GFP_KERNEL, &part->local_GPs_base);
+							GFP_KERNEL,
+							&part->local_GPs_base);
 	if (part->local_GPs == NULL) {
 		kfree(part->channels);
 		part->channels = NULL;
@@ -142,7 +135,9 @@ xpc_setup_infrastructure(struct xpc_part
 	}
 
 	part->remote_GPs = xpc_kzalloc_cacheline_aligned(XPC_GP_SIZE,
-					GFP_KERNEL, &part->remote_GPs_base);
+							 GFP_KERNEL,
+							 &part->
+							 remote_GPs_base);
 	if (part->remote_GPs == NULL) {
 		dev_err(xpc_chan, "can't get memory for remote get/put "
 			"values\n");
@@ -153,12 +148,11 @@ xpc_setup_infrastructure(struct xpc_part
 		return xpNoMemory;
 	}
 
-
 	/* allocate all the required open and close args */
 
-	part->local_openclose_args = xpc_kzalloc_cacheline_aligned(
-					XPC_OPENCLOSE_ARGS_SIZE, GFP_KERNEL,
-					&part->local_openclose_args_base);
+	part->local_openclose_args =
+	    xpc_kzalloc_cacheline_aligned(XPC_OPENCLOSE_ARGS_SIZE, GFP_KERNEL,
+					  &part->local_openclose_args_base);
 	if (part->local_openclose_args == NULL) {
 		dev_err(xpc_chan, "can't get memory for local connect args\n");
 		kfree(part->remote_GPs_base);
@@ -170,9 +164,9 @@ xpc_setup_infrastructure(struct xpc_part
 		return xpNoMemory;
 	}
 
-	part->remote_openclose_args = xpc_kzalloc_cacheline_aligned(
-					XPC_OPENCLOSE_ARGS_SIZE, GFP_KERNEL,
-					&part->remote_openclose_args_base);
+	part->remote_openclose_args =
+	    xpc_kzalloc_cacheline_aligned(XPC_OPENCLOSE_ARGS_SIZE, GFP_KERNEL,
+					  &part->remote_openclose_args_base);
 	if (part->remote_openclose_args == NULL) {
 		dev_err(xpc_chan, "can't get memory for remote connect args\n");
 		kfree(part->local_openclose_args_base);
@@ -186,13 +180,11 @@ xpc_setup_infrastructure(struct xpc_part
 		return xpNoMemory;
 	}
 
-
 	xpc_initialize_channels(part, partid);
 
 	atomic_set(&part->nchannels_active, 0);
 	atomic_set(&part->nchannels_engaged, 0);
 
-
 	/* local_IPI_amo were set to 0 by an earlier memset() */
 
 	/* Initialize this partitions AMO structure */
@@ -205,7 +197,7 @@ xpc_setup_infrastructure(struct xpc_part
 
 	sprintf(part->IPI_owner, "xpc%02d", partid);
 	ret = request_irq(SGI_XPC_NOTIFY, xpc_notify_IRQ_handler, IRQF_SHARED,
-				part->IPI_owner, (void *) (u64) partid);
+			  part->IPI_owner, (void *)(u64)partid);
 	if (ret != 0) {
 		dev_err(xpc_chan, "can't register NOTIFY IRQ handler, "
 			"errno=%d\n", -ret);
@@ -225,8 +217,8 @@ xpc_setup_infrastructure(struct xpc_part
 	/* Setup a timer to check for dropped IPIs */
 	timer = &part->dropped_IPI_timer;
 	init_timer(timer);
-	timer->function = (void (*)(unsigned long)) xpc_dropped_IPI_check;
-	timer->data = (unsigned long) part;
+	timer->function = (void (*)(unsigned long))xpc_dropped_IPI_check;
+	timer->data = (unsigned long)part;
 	timer->expires = jiffies + XPC_DROPPED_IPI_WAIT_INTERVAL;
 	add_timer(timer);
 
@@ -236,7 +228,6 @@ xpc_setup_infrastructure(struct xpc_part
 	 */
 	part->setup_state = XPC_P_SS_SETUP;
 
-
 	/*
 	 * Setup the per partition specific variables required by the
 	 * remote partition to establish channel connections with us.
@@ -246,7 +237,7 @@ xpc_setup_infrastructure(struct xpc_part
 	 */
 	xpc_vars_part[partid].GPs_pa = __pa(part->local_GPs);
 	xpc_vars_par
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[Patch 0/5] prepare XPC and XPNET to support SGI UV -v2, Dean Nelson, (Wed Mar 26, 12:38 pm)
[Patch 4/5] run drivers/misc/xp through scripts/Lindent -v2, Dean Nelson, (Wed Mar 26, 12:52 pm)
[Patch 2/5] move XP and XPC to drivers/misc/xp -v2, Dean Nelson, (Wed Mar 26, 12:50 pm)
speck-geostationary