diff mbox

spar: remove extra type variable

Message ID 1470731119-14661-1-git-send-email-clg@kaod.org
State New
Headers show

Commit Message

Cédric Le Goater Aug. 9, 2016, 8:25 a.m. UTC
The sPAPR CPU core typename is already available in the upper
block.

Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
 hw/ppc/spapr.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Thomas Huth Aug. 9, 2016, 11:05 a.m. UTC | #1
On 09.08.2016 10:25, Cédric Le Goater wrote:
> The sPAPR CPU core typename is already available in the upper
> block.
> 
> Signed-off-by: Cédric Le Goater <clg@kaod.org>
> ---
>  hw/ppc/spapr.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
> index fdc6644d61cb..6dc5fe48971e 100644
> --- a/hw/ppc/spapr.c
> +++ b/hw/ppc/spapr.c
> @@ -1783,7 +1783,6 @@ static void ppc_spapr_init(MachineState *machine)
>              qemu_register_reset(spapr_drc_reset, drc);
>  
>              if (i < spapr_cores) {
> -                char *type = spapr_get_cpu_core_type(machine->cpu_model);
>                  Object *core;
>  
>                  if (!object_class_by_name(type)) {

Good point. But I think the "if (!object_class_by_name(type))" check
could then also be moved to the outer block instead.

 Thomas
Cédric Le Goater Aug. 9, 2016, 11:07 a.m. UTC | #2
On 08/09/2016 01:05 PM, Thomas Huth wrote:
> On 09.08.2016 10:25, Cédric Le Goater wrote:
>> The sPAPR CPU core typename is already available in the upper
>> block.
>>
>> Signed-off-by: Cédric Le Goater <clg@kaod.org>
>> ---
>>  hw/ppc/spapr.c | 1 -
>>  1 file changed, 1 deletion(-)
>>
>> diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
>> index fdc6644d61cb..6dc5fe48971e 100644
>> --- a/hw/ppc/spapr.c
>> +++ b/hw/ppc/spapr.c
>> @@ -1783,7 +1783,6 @@ static void ppc_spapr_init(MachineState *machine)
>>              qemu_register_reset(spapr_drc_reset, drc);
>>  
>>              if (i < spapr_cores) {
>> -                char *type = spapr_get_cpu_core_type(machine->cpu_model);
>>                  Object *core;
>>  
>>                  if (!object_class_by_name(type)) {
> 
> Good point. But I think the "if (!object_class_by_name(type))" check
> could then also be moved to the outer block instead.

yes. I will rework that. 

Thanks,

C.
diff mbox

Patch

diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index fdc6644d61cb..6dc5fe48971e 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -1783,7 +1783,6 @@  static void ppc_spapr_init(MachineState *machine)
             qemu_register_reset(spapr_drc_reset, drc);
 
             if (i < spapr_cores) {
-                char *type = spapr_get_cpu_core_type(machine->cpu_model);
                 Object *core;
 
                 if (!object_class_by_name(type)) {