[Skiboot] [PATCH 29/32] xive: Use a constant for max# of chips

Benjamin Herrenschmidt benh at kernel.crashing.org
Tue Nov 22 13:13:31 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 bfc9c26..0399743 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);
 
@@ -3277,7 +3277,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.7.4



More information about the Skiboot mailing list