diff mbox series

[v2,19/19] ppc/pnv: Move num_phbs under Pnv8Chip

Message ID 20211213132830.108372-20-clg@kaod.org
State Superseded
Headers show
Series ppc/pnv: Add support for user created PHB3/PHB4 devices | expand

Commit Message

Cédric Le Goater Dec. 13, 2021, 1:28 p.m. UTC
It is not used elsewhere so that's where it belongs.

Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
 include/hw/ppc/pnv.h | 4 ++--
 hw/ppc/pnv.c         | 7 +++----
 2 files changed, 5 insertions(+), 6 deletions(-)

Comments

Daniel Henrique Barboza Jan. 4, 2022, 9:53 a.m. UTC | #1
On 12/13/21 10:28, Cédric Le Goater wrote:
> It is not used elsewhere so that's where it belongs.
> 
> Signed-off-by: Cédric Le Goater <clg@kaod.org>
> ---

I am/was using this patch and didn't provide my r-b on it:


Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>


>   include/hw/ppc/pnv.h | 4 ++--
>   hw/ppc/pnv.c         | 7 +++----
>   2 files changed, 5 insertions(+), 6 deletions(-)
> 
> diff --git a/include/hw/ppc/pnv.h b/include/hw/ppc/pnv.h
> index ca27bd39f0ac..251c9854329d 100644
> --- a/include/hw/ppc/pnv.h
> +++ b/include/hw/ppc/pnv.h
> @@ -52,7 +52,6 @@ struct PnvChip {
>       uint64_t     cores_mask;
>       PnvCore      **cores;
>   
> -    uint32_t     num_phbs;
>       uint32_t     num_pecs;
>   
>       MemoryRegion xscom_mmio;
> @@ -82,6 +81,7 @@ struct Pnv8Chip {
>   
>   #define PNV8_CHIP_PHB3_MAX 4
>       PnvPHB3      phbs[PNV8_CHIP_PHB3_MAX];
> +    uint32_t     num_phbs;
>   
>       XICSFabric    *xics;
>   };
> @@ -136,8 +136,8 @@ struct PnvChipClass {
>       /*< public >*/
>       uint64_t     chip_cfam_id;
>       uint64_t     cores_mask;
> -    uint32_t     num_phbs;
>       uint32_t     num_pecs;
> +    uint32_t     num_phbs;
>   
>       DeviceRealize parent_realize;
>   
> diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c
> index 2b027e299d27..8a3732c982e5 100644
> --- a/hw/ppc/pnv.c
> +++ b/hw/ppc/pnv.c
> @@ -1099,7 +1099,6 @@ static void pnv_chip_power10_intc_print_info(PnvChip *chip, PowerPCCPU *cpu,
>   
>   static void pnv_chip_power8_instance_init(Object *obj)
>   {
> -    PnvChip *chip = PNV_CHIP(obj);
>       Pnv8Chip *chip8 = PNV8_CHIP(obj);
>       PnvChipClass *pcc = PNV_CHIP_GET_CLASS(obj);
>       int i;
> @@ -1118,10 +1117,10 @@ static void pnv_chip_power8_instance_init(Object *obj)
>       object_initialize_child(obj, "homer", &chip8->homer, TYPE_PNV8_HOMER);
>   
>       if (defaults_enabled()) {
> -        chip->num_phbs = pcc->num_phbs;
> +        chip8->num_phbs = pcc->num_phbs;
>       }
>   
> -    for (i = 0; i < chip->num_phbs; i++) {
> +    for (i = 0; i < chip8->num_phbs; i++) {
>           object_initialize_child(obj, "phb[*]", &chip8->phbs[i], TYPE_PNV_PHB3);
>       }
>   
> @@ -1239,7 +1238,7 @@ static void pnv_chip_power8_realize(DeviceState *dev, Error **errp)
>                                   &chip8->homer.regs);
>   
>       /* PHB3 controllers */
> -    for (i = 0; i < chip->num_phbs; i++) {
> +    for (i = 0; i < chip8->num_phbs; i++) {
>           PnvPHB3 *phb = &chip8->phbs[i];
>   
>           object_property_set_int(OBJECT(phb), "index", i, &error_fatal);
Cédric Le Goater Jan. 4, 2022, 10:07 a.m. UTC | #2
On 1/4/22 10:53, Daniel Henrique Barboza wrote:
> 
> 
> On 12/13/21 10:28, Cédric Le Goater wrote:
>> It is not used elsewhere so that's where it belongs.
>>
>> Signed-off-by: Cédric Le Goater <clg@kaod.org>
>> ---
> 
> I am/was using this patch and didn't provide my r-b on it:
> 
> 
> Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>

Yes. Just resend with your next series.

Thanks,

C.


> 
>>   include/hw/ppc/pnv.h | 4 ++--
>>   hw/ppc/pnv.c         | 7 +++----
>>   2 files changed, 5 insertions(+), 6 deletions(-)
>>
>> diff --git a/include/hw/ppc/pnv.h b/include/hw/ppc/pnv.h
>> index ca27bd39f0ac..251c9854329d 100644
>> --- a/include/hw/ppc/pnv.h
>> +++ b/include/hw/ppc/pnv.h
>> @@ -52,7 +52,6 @@ struct PnvChip {
>>       uint64_t     cores_mask;
>>       PnvCore      **cores;
>> -    uint32_t     num_phbs;
>>       uint32_t     num_pecs;
>>       MemoryRegion xscom_mmio;
>> @@ -82,6 +81,7 @@ struct Pnv8Chip {
>>   #define PNV8_CHIP_PHB3_MAX 4
>>       PnvPHB3      phbs[PNV8_CHIP_PHB3_MAX];
>> +    uint32_t     num_phbs;
>>       XICSFabric    *xics;
>>   };
>> @@ -136,8 +136,8 @@ struct PnvChipClass {
>>       /*< public >*/
>>       uint64_t     chip_cfam_id;
>>       uint64_t     cores_mask;
>> -    uint32_t     num_phbs;
>>       uint32_t     num_pecs;
>> +    uint32_t     num_phbs;
>>       DeviceRealize parent_realize;
>> diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c
>> index 2b027e299d27..8a3732c982e5 100644
>> --- a/hw/ppc/pnv.c
>> +++ b/hw/ppc/pnv.c
>> @@ -1099,7 +1099,6 @@ static void pnv_chip_power10_intc_print_info(PnvChip *chip, PowerPCCPU *cpu,
>>   static void pnv_chip_power8_instance_init(Object *obj)
>>   {
>> -    PnvChip *chip = PNV_CHIP(obj);
>>       Pnv8Chip *chip8 = PNV8_CHIP(obj);
>>       PnvChipClass *pcc = PNV_CHIP_GET_CLASS(obj);
>>       int i;
>> @@ -1118,10 +1117,10 @@ static void pnv_chip_power8_instance_init(Object *obj)
>>       object_initialize_child(obj, "homer", &chip8->homer, TYPE_PNV8_HOMER);
>>       if (defaults_enabled()) {
>> -        chip->num_phbs = pcc->num_phbs;
>> +        chip8->num_phbs = pcc->num_phbs;
>>       }
>> -    for (i = 0; i < chip->num_phbs; i++) {
>> +    for (i = 0; i < chip8->num_phbs; i++) {
>>           object_initialize_child(obj, "phb[*]", &chip8->phbs[i], TYPE_PNV_PHB3);
>>       }
>> @@ -1239,7 +1238,7 @@ static void pnv_chip_power8_realize(DeviceState *dev, Error **errp)
>>                                   &chip8->homer.regs);
>>       /* PHB3 controllers */
>> -    for (i = 0; i < chip->num_phbs; i++) {
>> +    for (i = 0; i < chip8->num_phbs; i++) {
>>           PnvPHB3 *phb = &chip8->phbs[i];
>>           object_property_set_int(OBJECT(phb), "index", i, &error_fatal);
diff mbox series

Patch

diff --git a/include/hw/ppc/pnv.h b/include/hw/ppc/pnv.h
index ca27bd39f0ac..251c9854329d 100644
--- a/include/hw/ppc/pnv.h
+++ b/include/hw/ppc/pnv.h
@@ -52,7 +52,6 @@  struct PnvChip {
     uint64_t     cores_mask;
     PnvCore      **cores;
 
-    uint32_t     num_phbs;
     uint32_t     num_pecs;
 
     MemoryRegion xscom_mmio;
@@ -82,6 +81,7 @@  struct Pnv8Chip {
 
 #define PNV8_CHIP_PHB3_MAX 4
     PnvPHB3      phbs[PNV8_CHIP_PHB3_MAX];
+    uint32_t     num_phbs;
 
     XICSFabric    *xics;
 };
@@ -136,8 +136,8 @@  struct PnvChipClass {
     /*< public >*/
     uint64_t     chip_cfam_id;
     uint64_t     cores_mask;
-    uint32_t     num_phbs;
     uint32_t     num_pecs;
+    uint32_t     num_phbs;
 
     DeviceRealize parent_realize;
 
diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c
index 2b027e299d27..8a3732c982e5 100644
--- a/hw/ppc/pnv.c
+++ b/hw/ppc/pnv.c
@@ -1099,7 +1099,6 @@  static void pnv_chip_power10_intc_print_info(PnvChip *chip, PowerPCCPU *cpu,
 
 static void pnv_chip_power8_instance_init(Object *obj)
 {
-    PnvChip *chip = PNV_CHIP(obj);
     Pnv8Chip *chip8 = PNV8_CHIP(obj);
     PnvChipClass *pcc = PNV_CHIP_GET_CLASS(obj);
     int i;
@@ -1118,10 +1117,10 @@  static void pnv_chip_power8_instance_init(Object *obj)
     object_initialize_child(obj, "homer", &chip8->homer, TYPE_PNV8_HOMER);
 
     if (defaults_enabled()) {
-        chip->num_phbs = pcc->num_phbs;
+        chip8->num_phbs = pcc->num_phbs;
     }
 
-    for (i = 0; i < chip->num_phbs; i++) {
+    for (i = 0; i < chip8->num_phbs; i++) {
         object_initialize_child(obj, "phb[*]", &chip8->phbs[i], TYPE_PNV_PHB3);
     }
 
@@ -1239,7 +1238,7 @@  static void pnv_chip_power8_realize(DeviceState *dev, Error **errp)
                                 &chip8->homer.regs);
 
     /* PHB3 controllers */
-    for (i = 0; i < chip->num_phbs; i++) {
+    for (i = 0; i < chip8->num_phbs; i++) {
         PnvPHB3 *phb = &chip8->phbs[i];
 
         object_property_set_int(OBJECT(phb), "index", i, &error_fatal);