|
From: | Daniel Henrique Barboza |
Subject: | Re: [PATCH 15/17] ppc/pnv: convert pec->stacks[] into pec->phbs[] |
Date: | Fri, 14 Jan 2022 10:40:09 -0300 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.4.0 |
On 1/14/22 10:33, Cédric Le Goater wrote:
@@ -1520,14 +1520,19 @@ static PnvPhb4PecStack *pnv_phb4_get_stack(PnvChip *chip, PnvPHB4 *phb, for (i = 0; i < chip->num_pecs; i++) { /* - * For each PEC, check the amount of stacks it supports - * and see if the given phb4 index matches a stack. + * For each PEC, check the amount of phbs it supports + * and see if the given phb4 index matches an index. */ PnvPhb4PecState *pec = &chip9->pecs[i]; - for (j = 0; j < pec->num_stacks; j++) { + for (j = 0; j < pec->num_phbs; j++) { if (index == pnv_phb4_pec_get_phb_id(pec, j)) { - return &pec->stacks[j]; + pec->phbs[j] = phb;Why do we need this array ?
Actually we don't. While making these patches I forgot to assign this pointer back to the array and everything worked. We don't search the PHB back from the PEC at any point. This is being kept because I refrain from doing too much design changes at once. We can drop it though - either in this patch or in a follow up.
+ + /* Set phb-number now since we already have it */ + object_property_set_int(OBJECT(phb), "phb-number", + j, &error_abort);that's ugly :/
Not my proudest line of code indeed. Perhaps we're better of trying to get rid of stack->stack_no altogether before even converting it to phb->stack_no. I'll see how that goes. Daniel
C.+ return pec; } } }
[Prev in Thread] | Current Thread | [Next in Thread] |