[Skiboot] [PATCH 31/60] xive: Use a constant for max# of chips

Benjamin Herrenschmidt benh at kernel.crashing.org
Thu Dec 22 14:16:39 AEDT 2016


Signed-off-by: Benjamin Herrenschmidt <benh at kernel.crashing.org>
---
 hw/xive.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/hw/xive.c b/hw/xive.c
index a4ee955..b164544 100644
--- a/hw/xive.c
+++ b/hw/xive.c
@@ -400,7 +400,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.
@@ -2379,8 +2380,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);
 
@@ -3283,7 +3283,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;
 }
 
-- 
2.9.3



More information about the Skiboot mailing list