aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc/sgi-xp/xpc_partition.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/misc/sgi-xp/xpc_partition.c')
-rw-r--r--drivers/misc/sgi-xp/xpc_partition.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/drivers/misc/sgi-xp/xpc_partition.c b/drivers/misc/sgi-xp/xpc_partition.c
index 7dd4b5812c4..02a858eddd8 100644
--- a/drivers/misc/sgi-xp/xpc_partition.c
+++ b/drivers/misc/sgi-xp/xpc_partition.c
@@ -51,13 +51,7 @@ struct xpc_vars_part *xpc_vars_part;
51static int xp_nasid_mask_bytes; /* actual size in bytes of nasid mask */ 51static int xp_nasid_mask_bytes; /* actual size in bytes of nasid mask */
52static int xp_nasid_mask_words; /* actual size in words of nasid mask */ 52static int xp_nasid_mask_words; /* actual size in words of nasid mask */
53 53
54/* 54struct xpc_partition *xpc_partitions;
55 * For performance reasons, each entry of xpc_partitions[] is cacheline
56 * aligned. And xpc_partitions[] is padded with an additional entry at the
57 * end so that the last legitimate entry doesn't share its cacheline with
58 * another variable.
59 */
60struct xpc_partition xpc_partitions[XP_MAX_PARTITIONS + 1];
61 55
62/* 56/*
63 * Generic buffer used to store a local copy of portions of a remote 57 * Generic buffer used to store a local copy of portions of a remote
@@ -261,7 +255,7 @@ xpc_rsvd_page_init(void)
261 255
262 /* clear xpc_vars_part */ 256 /* clear xpc_vars_part */
263 memset((u64 *)xpc_vars_part, 0, sizeof(struct xpc_vars_part) * 257 memset((u64 *)xpc_vars_part, 0, sizeof(struct xpc_vars_part) *
264 XP_MAX_PARTITIONS); 258 xp_max_npartitions);
265 259
266 /* initialize the activate IRQ related AMO variables */ 260 /* initialize the activate IRQ related AMO variables */
267 for (i = 0; i < xp_nasid_mask_words; i++) 261 for (i = 0; i < xp_nasid_mask_words; i++)
@@ -408,7 +402,7 @@ xpc_check_remote_hb(void)
408 402
409 remote_vars = (struct xpc_vars *)xpc_remote_copy_buffer; 403 remote_vars = (struct xpc_vars *)xpc_remote_copy_buffer;
410 404
411 for (partid = 1; partid < XP_MAX_PARTITIONS; partid++) { 405 for (partid = 0; partid < xp_max_npartitions; partid++) {
412 406
413 if (xpc_exiting) 407 if (xpc_exiting)
414 break; 408 break;
@@ -487,10 +481,8 @@ xpc_get_remote_rp(int nasid, u64 *discovered_nasids,
487 481
488 /* check that the partid is for another partition */ 482 /* check that the partid is for another partition */
489 483
490 if (remote_rp->partid < 1 || 484 if (remote_rp->partid < 0 || remote_rp->partid >= xp_max_npartitions)
491 remote_rp->partid > (XP_MAX_PARTITIONS - 1)) {
492 return xpInvalidPartid; 485 return xpInvalidPartid;
493 }
494 486
495 if (remote_rp->partid == sn_partition_id) 487 if (remote_rp->partid == sn_partition_id)
496 return xpLocalPartid; 488 return xpLocalPartid;