Commit 4a3ad2dd authored by Dean Nelson's avatar Dean Nelson Committed by Tony Luck

[IA64] run some drivers/misc/sgi-xp through scripts/Lindent

Ran patches through scripts/Lindent (part 1).
Signed-off-by: default avatarDean Nelson <dcn@sgi.com>
Signed-off-by: default avatarTony Luck <tony.luck@intel.com>
parent 45d9ca49
...@@ -6,30 +6,25 @@ ...@@ -6,30 +6,25 @@
* Copyright (C) 2004-2008 Silicon Graphics, Inc. All rights reserved. * Copyright (C) 2004-2008 Silicon Graphics, Inc. All rights reserved.
*/ */
/* /*
* External Cross Partition (XP) structures and defines. * External Cross Partition (XP) structures and defines.
*/ */
#ifndef _DRIVERS_MISC_SGIXP_XP_H #ifndef _DRIVERS_MISC_SGIXP_XP_H
#define _DRIVERS_MISC_SGIXP_XP_H #define _DRIVERS_MISC_SGIXP_XP_H
#include <linux/cache.h> #include <linux/cache.h>
#include <linux/hardirq.h> #include <linux/hardirq.h>
#include <linux/mutex.h> #include <linux/mutex.h>
#include <asm/sn/types.h> #include <asm/sn/types.h>
#include <asm/sn/bte.h> #include <asm/sn/bte.h>
#ifdef USE_DBUG_ON #ifdef USE_DBUG_ON
#define DBUG_ON(condition) BUG_ON(condition) #define DBUG_ON(condition) BUG_ON(condition)
#else #else
#define DBUG_ON(condition) #define DBUG_ON(condition)
#endif #endif
/* /*
* Define the maximum number of logically defined partitions the system * Define the maximum number of logically defined partitions the system
* can support. It is constrained by the maximum number of hardware * can support. It is constrained by the maximum number of hardware
...@@ -43,7 +38,6 @@ ...@@ -43,7 +38,6 @@
*/ */
#define XP_MAX_PARTITIONS 64 #define XP_MAX_PARTITIONS 64
/* /*
* Define the number of u64s required to represent all the C-brick nasids * Define the number of u64s required to represent all the C-brick nasids
* as a bitmap. The cross-partition kernel modules deal only with * as a bitmap. The cross-partition kernel modules deal only with
...@@ -54,7 +48,6 @@ ...@@ -54,7 +48,6 @@
#define XP_NASID_MASK_BYTES ((XP_MAX_PHYSNODE_ID + 7) / 8) #define XP_NASID_MASK_BYTES ((XP_MAX_PHYSNODE_ID + 7) / 8)
#define XP_NASID_MASK_WORDS ((XP_MAX_PHYSNODE_ID + 63) / 64) #define XP_NASID_MASK_WORDS ((XP_MAX_PHYSNODE_ID + 63) / 64)
/* /*
* Wrapper for bte_copy() that should it return a failure status will retry * Wrapper for bte_copy() that should it return a failure status will retry
* the bte_copy() once in the hope that the failure was due to a temporary * the bte_copy() once in the hope that the failure was due to a temporary
...@@ -74,7 +67,6 @@ xp_bte_copy(u64 src, u64 vdst, u64 len, u64 mode, void *notification) ...@@ -74,7 +67,6 @@ xp_bte_copy(u64 src, u64 vdst, u64 len, u64 mode, void *notification)
bte_result_t ret; bte_result_t ret;
u64 pdst = ia64_tpa(vdst); u64 pdst = ia64_tpa(vdst);
/* /*
* Ensure that the physically mapped memory is contiguous. * Ensure that the physically mapped memory is contiguous.
* *
...@@ -96,7 +88,6 @@ xp_bte_copy(u64 src, u64 vdst, u64 len, u64 mode, void *notification) ...@@ -96,7 +88,6 @@ xp_bte_copy(u64 src, u64 vdst, u64 len, u64 mode, void *notification)
return ret; return ret;
} }
/* /*
* XPC establishes channel connections between the local partition and any * XPC establishes channel connections between the local partition and any
* other partition that is currently up. Over these channels, kernel-level * other partition that is currently up. Over these channels, kernel-level
...@@ -122,7 +113,6 @@ xp_bte_copy(u64 src, u64 vdst, u64 len, u64 mode, void *notification) ...@@ -122,7 +113,6 @@ xp_bte_copy(u64 src, u64 vdst, u64 len, u64 mode, void *notification)
#error XPC_NCHANNELS exceeds MAXIMUM allowed. #error XPC_NCHANNELS exceeds MAXIMUM allowed.
#endif #endif
/* /*
* The format of an XPC message is as follows: * The format of an XPC message is as follows:
* *
...@@ -160,12 +150,10 @@ struct xpc_msg { ...@@ -160,12 +150,10 @@ struct xpc_msg {
u64 payload; /* user defined portion of message */ u64 payload; /* user defined portion of message */
}; };
#define XPC_MSG_PAYLOAD_OFFSET (u64) (&((struct xpc_msg *)0)->payload) #define XPC_MSG_PAYLOAD_OFFSET (u64) (&((struct xpc_msg *)0)->payload)
#define XPC_MSG_SIZE(_payload_size) \ #define XPC_MSG_SIZE(_payload_size) \
L1_CACHE_ALIGN(XPC_MSG_PAYLOAD_OFFSET + (_payload_size)) L1_CACHE_ALIGN(XPC_MSG_PAYLOAD_OFFSET + (_payload_size))
/* /*
* Define the return values and values passed to user's callout functions. * 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 * (It is important to add new value codes at the end just preceding
...@@ -270,7 +258,6 @@ enum xpc_retval { ...@@ -270,7 +258,6 @@ enum xpc_retval {
xpcUnknownReason /* 116: unknown reason -- must be last in list */ xpcUnknownReason /* 116: unknown reason -- must be last in list */
}; };
/* /*
* Define the callout function types used by XPC to update the user on * Define the callout function types used by XPC to update the user on
* connection activity and state changes (via the user function registered by * connection activity and state changes (via the user function registered by
...@@ -375,13 +362,12 @@ enum xpc_retval { ...@@ -375,13 +362,12 @@ enum xpc_retval {
* =====================+================================+===================== * =====================+================================+=====================
*/ */
typedef void (*xpc_channel_func)(enum xpc_retval reason, partid_t partid, typedef void (*xpc_channel_func) (enum xpc_retval reason, partid_t partid,
int ch_number, void *data, void *key); int ch_number, void *data, void *key);
typedef void (*xpc_notify_func)(enum xpc_retval reason, partid_t partid, typedef void (*xpc_notify_func) (enum xpc_retval reason, partid_t partid,
int ch_number, void *key); int ch_number, void *key);
/* /*
* The following is a registration entry. There is a global array of these, * The following is a registration entry. There is a global array of these,
* one per channel. It is used to record the connection registration made * one per channel. It is used to record the connection registration made
...@@ -406,40 +392,35 @@ struct xpc_registration { ...@@ -406,40 +392,35 @@ struct xpc_registration {
u32 idle_limit; /* limit on #of idle kthreads */ u32 idle_limit; /* limit on #of idle kthreads */
} ____cacheline_aligned; } ____cacheline_aligned;
#define XPC_CHANNEL_REGISTERED(_c) (xpc_registrations[_c].func != NULL) #define XPC_CHANNEL_REGISTERED(_c) (xpc_registrations[_c].func != NULL)
/* the following are valid xpc_allocate() flags */ /* the following are valid xpc_allocate() flags */
#define XPC_WAIT 0 /* wait flag */ #define XPC_WAIT 0 /* wait flag */
#define XPC_NOWAIT 1 /* no wait flag */ #define XPC_NOWAIT 1 /* no wait flag */
struct xpc_interface { struct xpc_interface {
void (*connect)(int); void (*connect) (int);
void (*disconnect)(int); void (*disconnect) (int);
enum xpc_retval (*allocate)(partid_t, int, u32, void **); enum xpc_retval (*allocate) (partid_t, int, u32, void **);
enum xpc_retval (*send)(partid_t, int, void *); enum xpc_retval (*send) (partid_t, int, void *);
enum xpc_retval (*send_notify)(partid_t, int, void *, enum xpc_retval (*send_notify) (partid_t, int, void *,
xpc_notify_func, void *); xpc_notify_func, void *);
void (*received)(partid_t, int, void *); void (*received) (partid_t, int, void *);
enum xpc_retval (*partid_to_nasids)(partid_t, void *); enum xpc_retval (*partid_to_nasids) (partid_t, void *);
}; };
extern struct xpc_interface xpc_interface; extern struct xpc_interface xpc_interface;
extern void xpc_set_interface(void (*)(int), extern void xpc_set_interface(void (*)(int),
void (*)(int), void (*)(int),
enum xpc_retval (*)(partid_t, int, u32, void **), enum xpc_retval (*)(partid_t, int, u32, void **),
enum xpc_retval (*)(partid_t, int, void *), enum xpc_retval (*)(partid_t, int, void *),
enum xpc_retval (*)(partid_t, int, void *, xpc_notify_func, enum xpc_retval (*)(partid_t, int, void *,
void *), xpc_notify_func, void *),
void (*)(partid_t, int, void *), void (*)(partid_t, int, void *),
enum xpc_retval (*)(partid_t, void *)); enum xpc_retval (*)(partid_t, void *));
extern void xpc_clear_interface(void); extern void xpc_clear_interface(void);
extern enum xpc_retval xpc_connect(int, xpc_channel_func, void *, u16, extern enum xpc_retval xpc_connect(int, xpc_channel_func, void *, u16,
u16, u32, u32); u16, u32, u32);
extern void xpc_disconnect(int); extern void xpc_disconnect(int);
...@@ -475,11 +456,8 @@ xpc_partid_to_nasids(partid_t partid, void *nasids) ...@@ -475,11 +456,8 @@ xpc_partid_to_nasids(partid_t partid, void *nasids)
return xpc_interface.partid_to_nasids(partid, nasids); return xpc_interface.partid_to_nasids(partid, nasids);
} }
extern u64 xp_nofault_PIOR_target; extern u64 xp_nofault_PIOR_target;
extern int xp_nofault_PIOR(void *); extern int xp_nofault_PIOR(void *);
extern int xp_error_PIOR(void); extern int xp_error_PIOR(void);
#endif /* _DRIVERS_MISC_SGIXP_XP_H */ #endif /* _DRIVERS_MISC_SGIXP_XP_H */
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
* Copyright (c) 2004-2008 Silicon Graphics, Inc. All Rights Reserved. * Copyright (c) 2004-2008 Silicon Graphics, Inc. All Rights Reserved.
*/ */
/* /*
* Cross Partition (XP) base. * Cross Partition (XP) base.
* *
...@@ -15,7 +14,6 @@ ...@@ -15,7 +14,6 @@
* *
*/ */
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/module.h> #include <linux/module.h>
...@@ -24,49 +22,49 @@ ...@@ -24,49 +22,49 @@
#include <asm/sn/sn_sal.h> #include <asm/sn/sn_sal.h>
#include "xp.h" #include "xp.h"
/* /*
* Target of nofault PIO read. * Target of nofault PIO read.
*/ */
u64 xp_nofault_PIOR_target; u64 xp_nofault_PIOR_target;
/* /*
* xpc_registrations[] keeps track of xpc_connect()'s done by the kernel-level * xpc_registrations[] keeps track of xpc_connect()'s done by the kernel-level
* users of XPC. * users of XPC.
*/ */
struct xpc_registration xpc_registrations[XPC_NCHANNELS]; struct xpc_registration xpc_registrations[XPC_NCHANNELS];
/* /*
* Initialize the XPC interface to indicate that XPC isn't loaded. * Initialize the XPC interface to indicate that XPC isn't loaded.
*/ */
static enum xpc_retval xpc_notloaded(void) { return xpcNotLoaded; } static enum xpc_retval
xpc_notloaded(void)
{
return xpcNotLoaded;
}
struct xpc_interface xpc_interface = { struct xpc_interface xpc_interface = {
(void (*)(int)) xpc_notloaded, (void (*)(int))xpc_notloaded,
(void (*)(int)) xpc_notloaded, (void (*)(int))xpc_notloaded,
(enum xpc_retval (*)(partid_t, int, u32, void **)) xpc_notloaded, (enum xpc_retval(*)(partid_t, int, u32, void **))xpc_notloaded,
(enum xpc_retval (*)(partid_t, int, void *)) xpc_notloaded, (enum xpc_retval(*)(partid_t, int, void *))xpc_notloaded,
(enum xpc_retval (*)(partid_t, int, void *, xpc_notify_func, void *)) (enum xpc_retval(*)(partid_t, int, void *, xpc_notify_func, void *))
xpc_notloaded, xpc_notloaded,
(void (*)(partid_t, int, void *)) xpc_notloaded, (void (*)(partid_t, int, void *))xpc_notloaded,
(enum xpc_retval (*)(partid_t, void *)) xpc_notloaded (enum xpc_retval(*)(partid_t, void *))xpc_notloaded
}; };
/* /*
* XPC calls this when it (the XPC module) has been loaded. * XPC calls this when it (the XPC module) has been loaded.
*/ */
void void
xpc_set_interface(void (*connect)(int), xpc_set_interface(void (*connect) (int),
void (*disconnect)(int), void (*disconnect) (int),
enum xpc_retval (*allocate)(partid_t, int, u32, void **), enum xpc_retval (*allocate) (partid_t, int, u32, void **),
enum xpc_retval (*send)(partid_t, int, void *), enum xpc_retval (*send) (partid_t, int, void *),
enum xpc_retval (*send_notify)(partid_t, int, void *, enum xpc_retval (*send_notify) (partid_t, int, void *,
xpc_notify_func, void *), xpc_notify_func, void *),
void (*received)(partid_t, int, void *), void (*received) (partid_t, int, void *),
enum xpc_retval (*partid_to_nasids)(partid_t, void *)) enum xpc_retval (*partid_to_nasids) (partid_t, void *))
{ {
xpc_interface.connect = connect; xpc_interface.connect = connect;
xpc_interface.disconnect = disconnect; xpc_interface.disconnect = disconnect;
...@@ -77,28 +75,27 @@ xpc_set_interface(void (*connect)(int), ...@@ -77,28 +75,27 @@ xpc_set_interface(void (*connect)(int),
xpc_interface.partid_to_nasids = partid_to_nasids; xpc_interface.partid_to_nasids = partid_to_nasids;
} }
/* /*
* XPC calls this when it (the XPC module) is being unloaded. * XPC calls this when it (the XPC module) is being unloaded.
*/ */
void void
xpc_clear_interface(void) xpc_clear_interface(void)
{ {
xpc_interface.connect = (void (*)(int)) xpc_notloaded; xpc_interface.connect = (void (*)(int))xpc_notloaded;
xpc_interface.disconnect = (void (*)(int)) xpc_notloaded; xpc_interface.disconnect = (void (*)(int))xpc_notloaded;
xpc_interface.allocate = (enum xpc_retval (*)(partid_t, int, u32, xpc_interface.allocate = (enum xpc_retval(*)(partid_t, int, u32,
void **)) xpc_notloaded; void **))xpc_notloaded;
xpc_interface.send = (enum xpc_retval (*)(partid_t, int, void *)) xpc_interface.send = (enum xpc_retval(*)(partid_t, int, void *))
xpc_notloaded; xpc_notloaded;
xpc_interface.send_notify = (enum xpc_retval (*)(partid_t, int, void *, xpc_interface.send_notify = (enum xpc_retval(*)(partid_t, int, void *,
xpc_notify_func, void *)) xpc_notloaded; xpc_notify_func,
void *))xpc_notloaded;
xpc_interface.received = (void (*)(partid_t, int, void *)) xpc_interface.received = (void (*)(partid_t, int, void *))
xpc_notloaded; xpc_notloaded;
xpc_interface.partid_to_nasids = (enum xpc_retval (*)(partid_t, void *)) xpc_interface.partid_to_nasids = (enum xpc_retval(*)(partid_t, void *))
xpc_notloaded; xpc_notloaded;
} }
/* /*
* Register for automatic establishment of a channel connection whenever * Register for automatic establishment of a channel connection whenever
* a partition comes up. * a partition comes up.
...@@ -129,7 +126,6 @@ xpc_connect(int ch_number, xpc_channel_func func, void *key, u16 payload_size, ...@@ -129,7 +126,6 @@ xpc_connect(int ch_number, xpc_channel_func func, void *key, u16 payload_size,
{ {
struct xpc_registration *registration; struct xpc_registration *registration;
DBUG_ON(ch_number < 0 || ch_number >= XPC_NCHANNELS); DBUG_ON(ch_number < 0 || ch_number >= XPC_NCHANNELS);
DBUG_ON(payload_size == 0 || nentries == 0); DBUG_ON(payload_size == 0 || nentries == 0);
DBUG_ON(func == NULL); DBUG_ON(func == NULL);
...@@ -162,7 +158,6 @@ xpc_connect(int ch_number, xpc_channel_func func, void *key, u16 payload_size, ...@@ -162,7 +158,6 @@ xpc_connect(int ch_number, xpc_channel_func func, void *key, u16 payload_size,
return xpcSuccess; return xpcSuccess;
} }
/* /*
* Remove the registration for automatic connection of the specified channel * Remove the registration for automatic connection of the specified channel
* when a partition comes up. * when a partition comes up.
...@@ -181,7 +176,6 @@ xpc_disconnect(int ch_number) ...@@ -181,7 +176,6 @@ xpc_disconnect(int ch_number)
{ {
struct xpc_registration *registration; struct xpc_registration *registration;
DBUG_ON(ch_number < 0 || ch_number >= XPC_NCHANNELS); DBUG_ON(ch_number < 0 || ch_number >= XPC_NCHANNELS);
registration = &xpc_registrations[ch_number]; registration = &xpc_registrations[ch_number];
...@@ -214,14 +208,12 @@ xpc_disconnect(int ch_number) ...@@ -214,14 +208,12 @@ xpc_disconnect(int ch_number)
return; return;
} }
int __init int __init
xp_init(void) xp_init(void)
{ {
int ret, ch_number; int ret, ch_number;
u64 func_addr = *(u64 *) xp_nofault_PIOR; u64 func_addr = *(u64 *)xp_nofault_PIOR;
u64 err_func_addr = *(u64 *) xp_error_PIOR; u64 err_func_addr = *(u64 *)xp_error_PIOR;
if (!ia64_platform_is("sn2")) { if (!ia64_platform_is("sn2")) {
return -ENODEV; return -ENODEV;
...@@ -258,22 +250,21 @@ xp_init(void) ...@@ -258,22 +250,21 @@ xp_init(void)
return 0; return 0;
} }
module_init(xp_init);
module_init(xp_init);
void __exit void __exit
xp_exit(void) xp_exit(void)
{ {
u64 func_addr = *(u64 *) xp_nofault_PIOR; u64 func_addr = *(u64 *)xp_nofault_PIOR;
u64 err_func_addr = *(u64 *) xp_error_PIOR; u64 err_func_addr = *(u64 *)xp_error_PIOR;
/* unregister the PIO read nofault code region */ /* unregister the PIO read nofault code region */
(void) sn_register_nofault_code(func_addr, err_func_addr, (void)sn_register_nofault_code(func_addr, err_func_addr,
err_func_addr, 1, 0); err_func_addr, 1, 0);
} }
module_exit(xp_exit);
module_exit(xp_exit);
MODULE_AUTHOR("Silicon Graphics, Inc."); MODULE_AUTHOR("Silicon Graphics, Inc.");
MODULE_DESCRIPTION("Cross Partition (XP) base"); MODULE_DESCRIPTION("Cross Partition (XP) base");
...@@ -287,4 +278,3 @@ EXPORT_SYMBOL(xpc_clear_interface); ...@@ -287,4 +278,3 @@ EXPORT_SYMBOL(xpc_clear_interface);
EXPORT_SYMBOL(xpc_set_interface); EXPORT_SYMBOL(xpc_set_interface);
EXPORT_SYMBOL(xpc_connect); EXPORT_SYMBOL(xpc_connect);
EXPORT_SYMBOL(xpc_disconnect); EXPORT_SYMBOL(xpc_disconnect);
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
* Copyright (c) 2004-2008 Silicon Graphics, Inc. All Rights Reserved. * Copyright (c) 2004-2008 Silicon Graphics, Inc. All Rights Reserved.
*/ */
/* /*
* The xp_nofault_PIOR function takes a pointer to a remote PIO register * The xp_nofault_PIOR function takes a pointer to a remote PIO register
* and attempts to load and consume a value from it. This function * and attempts to load and consume a value from it. This function
......
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment