aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2016-12-22 14:16:39 +1100
committerStewart Smith <stewart@linux.vnet.ibm.com>2017-01-05 15:27:44 +1100
commit2858c9086b91b890d9b064e6e0b02cdc05604c8c (patch)
treeabe1319471709b1a64997b35635d5a25c9bddeaa /hw
parente2a9e78a89c15844513a560d757e263406c3ba67 (diff)
downloadskiboot-2858c9086b91b890d9b064e6e0b02cdc05604c8c.zip
skiboot-2858c9086b91b890d9b064e6e0b02cdc05604c8c.tar.gz
skiboot-2858c9086b91b890d9b064e6e0b02cdc05604c8c.tar.bz2
xive: Use a constant for max# of chips
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/xive.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/hw/xive.c b/hw/xive.c
index 7ee93ad..267ad7f 100644
--- a/hw/xive.c
+++ b/hw/xive.c
@@ -403,7 +403,8 @@ struct xive {
* change in the future
*/
#define XIVE_INVALID_CHIP 0xffffffff
-static uint32_t xive_block_to_chip[16];
+#define XIVE_MAX_CHIPS 16
+static uint32_t xive_block_to_chip[XIVE_MAX_CHIPS];
static uint32_t xive_block_count;
/* Conversion between GIRQ and block/index.
@@ -2382,8 +2383,7 @@ static void init_one_xive(struct dt_node *np)
/* "Allocate" a new block ID for the chip */
x->block_id = xive_block_count++;
- /* XXX Hard coded limit of 16 chips ! */
- assert (x->block_id < 16);
+ assert (x->block_id < XIVE_MAX_CHIPS);
xive_block_to_chip[x->block_id] = x->chip_id;
init_lock(&x->lock);
@@ -3286,7 +3286,7 @@ static void xive_init_globals(void)
{
uint32_t i;
- for (i = 0; i < 16; i++)
+ for (i = 0; i < XIVE_MAX_CHIPS; i++)
xive_block_to_chip[i] = XIVE_INVALID_CHIP;
}