[Skiboot] [PATCH v2 07/11] xive/p9: Use sizeof() instead of hardcoded values

Cédric Le Goater clg at kaod.org
Fri Jun 12 21:37:28 AEST 2020


Reviewed-by: Gustavo Romero <gromero at linux.ibm.com>
Signed-off-by: Cédric Le Goater <clg at kaod.org>
---
 hw/xive.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/hw/xive.c b/hw/xive.c
index a106bd593052..9bc78de9542c 100644
--- a/hw/xive.c
+++ b/hw/xive.c
@@ -176,9 +176,10 @@
  *
  * TODO: adjust the VC BAR range for END ESBs on this value
  */
+#define EQ_PER_PAGE		(0x10000 / sizeof(struct xive_eq))
+
 #define XIVE_EQ_ORDER		20 /* 1M ENDs */
 #define XIVE_EQ_COUNT		(1ul << XIVE_EQ_ORDER)
-#define EQ_PER_PAGE		(0x10000 / 32) // Use sizeof ?
 #define IND_EQ_TABLE_SIZE	((XIVE_EQ_COUNT / EQ_PER_PAGE) * 8)
 
 #define XIVE_EQ_SHIFT		(16 + 1) /* ESn + ESe pages */
@@ -210,12 +211,12 @@
  *
  * XXX Adjust that based on BAR value ?
  */
+#define VP_PER_PAGE		(0x10000 / sizeof(struct xive_vp))
 
 #define NVT_SHIFT		19	/* in sync with EQ_W6_NVT_INDEX */
 
 #define MAX_VP_ORDER		NVT_SHIFT /* 512k */
 #define MAX_VP_COUNT		(1ul << MAX_VP_ORDER)
-#define VP_PER_PAGE		(0x10000 / 64) // Use sizeof ?
 #define IND_VP_TABLE_SIZE	((MAX_VP_COUNT / VP_PER_PAGE) * 8)
 
 /* Initial number of VPs (XXX Make it a variable ?). Round things
-- 
2.25.4



More information about the Skiboot mailing list