Skip to content

Commit

Permalink
drivers/misc/sgi-xp: replace partid_t with a short
Browse files Browse the repository at this point in the history
In preparation for supporting greater than 64 partitions replace partid_t by
short in drivers/misc/sgi-xp.

Signed-off-by: Dean Nelson <[email protected]>
Acked-by: Robin Holt <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Dean Nelson authored and torvalds committed May 13, 2008
1 parent 65c17b8 commit 64d032b
Show file tree
Hide file tree
Showing 7 changed files with 69 additions and 69 deletions.
34 changes: 17 additions & 17 deletions drivers/misc/sgi-xp/xp.h
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ enum xp_retval {
* When a failure reason code is received, one can assume that the channel
* is not connected.
*/
typedef void (*xpc_channel_func) (enum xp_retval reason, partid_t partid,
typedef void (*xpc_channel_func) (enum xp_retval reason, short partid,
int ch_number, void *data, void *key);

/*
Expand All @@ -286,7 +286,7 @@ typedef void (*xpc_channel_func) (enum xp_retval reason, partid_t partid,
*
* All other reason codes indicate failure.
*/
typedef void (*xpc_notify_func) (enum xp_retval reason, partid_t partid,
typedef void (*xpc_notify_func) (enum xp_retval reason, short partid,
int ch_number, void *key);

/*
Expand Down Expand Up @@ -322,57 +322,57 @@ struct xpc_registration {
struct xpc_interface {
void (*connect) (int);
void (*disconnect) (int);
enum xp_retval (*allocate) (partid_t, int, u32, void **);
enum xp_retval (*send) (partid_t, int, void *);
enum xp_retval (*send_notify) (partid_t, int, void *,
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) (partid_t, int, void *);
enum xp_retval (*partid_to_nasids) (partid_t, 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 (*)(partid_t, int, u32, void **),
enum xp_retval (*)(partid_t, int, void *),
enum xp_retval (*)(partid_t, int, void *,
enum xp_retval (*)(short, int, u32, void **),
enum xp_retval (*)(short, int, void *),
enum xp_retval (*)(short, int, void *,
xpc_notify_func, void *),
void (*)(partid_t, int, void *),
enum xp_retval (*)(partid_t, 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);
extern void xpc_disconnect(int);

static inline enum xp_retval
xpc_allocate(partid_t partid, int ch_number, u32 flags, void **payload)
xpc_allocate(short partid, int ch_number, u32 flags, void **payload)
{
return xpc_interface.allocate(partid, ch_number, flags, payload);
}

static inline enum xp_retval
xpc_send(partid_t partid, int ch_number, void *payload)
xpc_send(short partid, int ch_number, void *payload)
{
return xpc_interface.send(partid, ch_number, payload);
}

static inline enum xp_retval
xpc_send_notify(partid_t partid, int ch_number, void *payload,
xpc_send_notify(short partid, int ch_number, void *payload,
xpc_notify_func func, void *key)
{
return xpc_interface.send_notify(partid, ch_number, payload, func, key);
}

static inline void
xpc_received(partid_t partid, int ch_number, void *payload)
xpc_received(short partid, int ch_number, void *payload)
{
return xpc_interface.received(partid, ch_number, payload);
}

static inline enum xp_retval
xpc_partid_to_nasids(partid_t partid, void *nasids)
xpc_partid_to_nasids(short partid, void *nasids)
{
return xpc_interface.partid_to_nasids(partid, nasids);
}
Expand Down
30 changes: 15 additions & 15 deletions drivers/misc/sgi-xp/xp_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@ xpc_notloaded(void)
struct xpc_interface xpc_interface = {
(void (*)(int))xpc_notloaded,
(void (*)(int))xpc_notloaded,
(enum xp_retval(*)(partid_t, int, u32, void **))xpc_notloaded,
(enum xp_retval(*)(partid_t, int, void *))xpc_notloaded,
(enum xp_retval(*)(partid_t, int, void *, xpc_notify_func, void *))
(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 (*)(partid_t, int, void *))xpc_notloaded,
(enum xp_retval(*)(partid_t, void *))xpc_notloaded
(void (*)(short, int, void *))xpc_notloaded,
(enum xp_retval(*)(short, void *))xpc_notloaded
};
EXPORT_SYMBOL_GPL(xpc_interface);

Expand All @@ -66,12 +66,12 @@ EXPORT_SYMBOL_GPL(xpc_interface);
void
xpc_set_interface(void (*connect) (int),
void (*disconnect) (int),
enum xp_retval (*allocate) (partid_t, int, u32, void **),
enum xp_retval (*send) (partid_t, int, void *),
enum xp_retval (*send_notify) (partid_t, int, void *,
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) (partid_t, int, void *),
enum xp_retval (*partid_to_nasids) (partid_t, void *))
void (*received) (short, int, void *),
enum xp_retval (*partid_to_nasids) (short, void *))
{
xpc_interface.connect = connect;
xpc_interface.disconnect = disconnect;
Expand All @@ -91,16 +91,16 @@ xpc_clear_interface(void)
{
xpc_interface.connect = (void (*)(int))xpc_notloaded;
xpc_interface.disconnect = (void (*)(int))xpc_notloaded;
xpc_interface.allocate = (enum xp_retval(*)(partid_t, int, u32,
xpc_interface.allocate = (enum xp_retval(*)(short, int, u32,
void **))xpc_notloaded;
xpc_interface.send = (enum xp_retval(*)(partid_t, int, void *))
xpc_interface.send = (enum xp_retval(*)(short, int, void *))
xpc_notloaded;
xpc_interface.send_notify = (enum xp_retval(*)(partid_t, int, void *,
xpc_interface.send_notify = (enum xp_retval(*)(short, int, void *,
xpc_notify_func,
void *))xpc_notloaded;
xpc_interface.received = (void (*)(partid_t, int, void *))
xpc_interface.received = (void (*)(short, int, void *))
xpc_notloaded;
xpc_interface.partid_to_nasids = (enum xp_retval(*)(partid_t, void *))
xpc_interface.partid_to_nasids = (enum xp_retval(*)(short, void *))
xpc_notloaded;
}
EXPORT_SYMBOL_GPL(xpc_clear_interface);
Expand Down
20 changes: 10 additions & 10 deletions drivers/misc/sgi-xp/xpc.h
Original file line number Diff line number Diff line change
Expand Up @@ -172,13 +172,13 @@ struct xpc_vars {
(_version >= _XPC_VERSION(3, 1))

static inline int
xpc_hb_allowed(partid_t partid, struct xpc_vars *vars)
xpc_hb_allowed(short partid, struct xpc_vars *vars)
{
return ((vars->heartbeating_to_mask & (1UL << partid)) != 0);
}

static inline void
xpc_allow_hb(partid_t partid, struct xpc_vars *vars)
xpc_allow_hb(short partid, struct xpc_vars *vars)
{
u64 old_mask, new_mask;

Expand All @@ -190,7 +190,7 @@ xpc_allow_hb(partid_t partid, struct xpc_vars *vars)
}

static inline void
xpc_disallow_hb(partid_t partid, struct xpc_vars *vars)
xpc_disallow_hb(short partid, struct xpc_vars *vars)
{
u64 old_mask, new_mask;

Expand Down Expand Up @@ -408,7 +408,7 @@ struct xpc_notify {
* messages.
*/
struct xpc_channel {
partid_t partid; /* ID of remote partition connected */
short partid; /* ID of remote partition connected */
spinlock_t lock; /* lock for updating this structure */
u32 flags; /* general flags */

Expand Down Expand Up @@ -615,7 +615,7 @@ struct xpc_partition {
/* interval in seconds to print 'waiting disengagement' messages */
#define XPC_DISENGAGE_PRINTMSG_INTERVAL 10

#define XPC_PARTID(_p) ((partid_t) ((_p) - &xpc_partitions[0]))
#define XPC_PARTID(_p) ((short)((_p) - &xpc_partitions[0]))

/* found in xp_main.c */
extern struct xpc_registration xpc_registrations[];
Expand Down Expand Up @@ -652,16 +652,16 @@ extern void xpc_discovery(void);
extern void xpc_check_remote_hb(void);
extern void xpc_deactivate_partition(const int, struct xpc_partition *,
enum xp_retval);
extern enum xp_retval xpc_initiate_partid_to_nasids(partid_t, 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(partid_t, int, u32, void **);
extern enum xp_retval xpc_initiate_send(partid_t, int, void *);
extern enum xp_retval xpc_initiate_send_notify(partid_t, int, void *,
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 *);
extern void xpc_initiate_received(partid_t, int, 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 *);
extern void xpc_process_channel_activity(struct xpc_partition *);
Expand Down
20 changes: 10 additions & 10 deletions drivers/misc/sgi-xp/xpc_channel.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ xpc_kzalloc_cacheline_aligned(size_t size, gfp_t flags, void **base)
* Set up the initial values for the XPartition Communication channels.
*/
static void
xpc_initialize_channels(struct xpc_partition *part, partid_t partid)
xpc_initialize_channels(struct xpc_partition *part, short partid)
{
int ch_number;
struct xpc_channel *ch;
Expand Down Expand Up @@ -95,7 +95,7 @@ xpc_setup_infrastructure(struct xpc_partition *part)
{
int ret, cpuid;
struct timer_list *timer;
partid_t partid = XPC_PARTID(part);
short partid = XPC_PARTID(part);

/*
* Zero out MOST of the entry for this partition. Only the fields
Expand Down Expand Up @@ -290,7 +290,7 @@ xpc_pull_remote_vars_part(struct xpc_partition *part)
(struct xpc_vars_part *)L1_CACHE_ALIGN((u64)buffer);
struct xpc_vars_part *pulled_entry;
u64 remote_entry_cacheline_pa, remote_entry_pa;
partid_t partid = XPC_PARTID(part);
short partid = XPC_PARTID(part);
enum xp_retval ret;

/* pull the cacheline that contains the variables we're interested in */
Expand Down Expand Up @@ -1375,7 +1375,7 @@ xpc_partition_going_down(struct xpc_partition *part, enum xp_retval reason)
void
xpc_teardown_infrastructure(struct xpc_partition *part)
{
partid_t partid = XPC_PARTID(part);
short partid = XPC_PARTID(part);

/*
* We start off by making this partition inaccessible to local
Expand Down Expand Up @@ -1428,7 +1428,7 @@ xpc_teardown_infrastructure(struct xpc_partition *part)
void
xpc_initiate_connect(int ch_number)
{
partid_t partid;
short partid;
struct xpc_partition *part;
struct xpc_channel *ch;

Expand Down Expand Up @@ -1484,7 +1484,7 @@ void
xpc_initiate_disconnect(int ch_number)
{
unsigned long irq_flags;
partid_t partid;
short partid;
struct xpc_partition *part;
struct xpc_channel *ch;

Expand Down Expand Up @@ -1728,7 +1728,7 @@ xpc_allocate_msg(struct xpc_channel *ch, u32 flags,
* return) in which the user-defined message is constructed.
*/
enum xp_retval
xpc_initiate_allocate(partid_t partid, int ch_number, u32 flags, void **payload)
xpc_initiate_allocate(short partid, int ch_number, u32 flags, void **payload)
{
struct xpc_partition *part = &xpc_partitions[partid];
enum xp_retval ret = xpUnknownReason;
Expand Down Expand Up @@ -1909,7 +1909,7 @@ xpc_send_msg(struct xpc_channel *ch, struct xpc_msg *msg, u8 notify_type,
* xpc_initiate_allocate().
*/
enum xp_retval
xpc_initiate_send(partid_t partid, int ch_number, void *payload)
xpc_initiate_send(short partid, int ch_number, void *payload)
{
struct xpc_partition *part = &xpc_partitions[partid];
struct xpc_msg *msg = XPC_MSG_ADDRESS(payload);
Expand Down Expand Up @@ -1958,7 +1958,7 @@ xpc_initiate_send(partid_t partid, int ch_number, void *payload)
* key - user-defined key to be passed to the function when it's called.
*/
enum xp_retval
xpc_initiate_send_notify(partid_t partid, int ch_number, void *payload,
xpc_initiate_send_notify(short partid, int ch_number, void *payload,
xpc_notify_func func, void *key)
{
struct xpc_partition *part = &xpc_partitions[partid];
Expand Down Expand Up @@ -2203,7 +2203,7 @@ xpc_acknowledge_msgs(struct xpc_channel *ch, s64 initial_get, u8 msg_flags)
* xpc_initiate_allocate().
*/
void
xpc_initiate_received(partid_t partid, int ch_number, void *payload)
xpc_initiate_received(short partid, int ch_number, void *payload)
{
struct xpc_partition *part = &xpc_partitions[partid];
struct xpc_channel *ch;
Expand Down
16 changes: 8 additions & 8 deletions drivers/misc/sgi-xp/xpc_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ xpc_partition_up(struct xpc_partition *part)
static int
xpc_activating(void *__partid)
{
partid_t partid = (u64)__partid;
short partid = (u64)__partid;
struct xpc_partition *part = &xpc_partitions[partid];
unsigned long irq_flags;

Expand Down Expand Up @@ -499,7 +499,7 @@ xpc_activating(void *__partid)
void
xpc_activate_partition(struct xpc_partition *part)
{
partid_t partid = XPC_PARTID(part);
short partid = XPC_PARTID(part);
unsigned long irq_flags;
struct task_struct *kthread;

Expand Down Expand Up @@ -541,7 +541,7 @@ xpc_activate_partition(struct xpc_partition *part)
irqreturn_t
xpc_notify_IRQ_handler(int irq, void *dev_id)
{
partid_t partid = (partid_t) (u64)dev_id;
short partid = (short)(u64)dev_id;
struct xpc_partition *part = &xpc_partitions[partid];

DBUG_ON(partid <= 0 || partid >= XP_MAX_PARTITIONS);
Expand Down Expand Up @@ -643,7 +643,7 @@ xpc_kthread_waitmsgs(struct xpc_partition *part, struct xpc_channel *ch)
static int
xpc_kthread_start(void *args)
{
partid_t partid = XPC_UNPACK_ARG1(args);
short partid = XPC_UNPACK_ARG1(args);
u16 ch_number = XPC_UNPACK_ARG2(args);
struct xpc_partition *part = &xpc_partitions[partid];
struct xpc_channel *ch;
Expand Down Expand Up @@ -809,7 +809,7 @@ void
xpc_disconnect_wait(int ch_number)
{
unsigned long irq_flags;
partid_t partid;
short partid;
struct xpc_partition *part;
struct xpc_channel *ch;
int wakeup_channel_mgr;
Expand Down Expand Up @@ -859,7 +859,7 @@ xpc_disconnect_wait(int ch_number)
static void
xpc_do_exit(enum xp_retval reason)
{
partid_t partid;
short partid;
int active_part_count, printed_waiting_msg = 0;
struct xpc_partition *part;
unsigned long printmsg_time, disengage_request_timeout = 0;
Expand Down Expand Up @@ -1008,7 +1008,7 @@ static void
xpc_die_disengage(void)
{
struct xpc_partition *part;
partid_t partid;
short partid;
unsigned long engaged;
long time, printmsg_time, disengage_request_timeout;

Expand Down Expand Up @@ -1124,7 +1124,7 @@ int __init
xpc_init(void)
{
int ret;
partid_t partid;
short partid;
struct xpc_partition *part;
struct task_struct *kthread;
size_t buf_size;
Expand Down
Loading

0 comments on commit 64d032b

Please sign in to comment.