qemu-ppc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 15/17] ppc/pnv: convert pec->stacks[] into pec->phbs[]


From: Cédric Le Goater
Subject: Re: [PATCH 15/17] ppc/pnv: convert pec->stacks[] into pec->phbs[]
Date: Fri, 14 Jan 2022 14:33:37 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.3.0

@@ -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 ?

+
+                /* Set phb-number now since we already have it */
+                object_property_set_int(OBJECT(phb), "phb-number",
+                                               j, &error_abort);

that's ugly :/

C.

+                return pec;
              }
          }
      }



reply via email to

[Prev in Thread] Current Thread [Next in Thread]