qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH for-4.1 v2 30/36] cpu: Introduce cpu_set_cpustat


From: Richard Henderson
Subject: Re: [Qemu-devel] [PATCH for-4.1 v2 30/36] cpu: Introduce cpu_set_cpustate_pointers
Date: Mon, 6 May 2019 22:03:36 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1

On 4/29/19 7:40 AM, Peter Maydell wrote:
>> diff --git a/target/s390x/cpu.c b/target/s390x/cpu.c
>> index 698dd9cb82..790670ebeb 100644
>> --- a/target/s390x/cpu.c
>> +++ b/target/s390x/cpu.c
>> @@ -282,17 +282,18 @@ static void s390_cpu_initfn(Object *obj)
>>  {
>>      CPUState *cs = CPU(obj);
>>      S390CPU *cpu = S390_CPU(obj);
>> -    CPUS390XState *env = &cpu->env;
>>
>> -    cs->env_ptr = env;
>> +    cpu_set_cpustate_pointers(cpu);
>>      cs->halted = 1;
>>      cs->exception_index = EXCP_HLT;
>>      object_property_add(obj, "crash-information", "GuestPanicInformation",
>>                          s390_cpu_get_crash_info_qom, NULL, NULL, NULL, 
>> NULL);
>>      s390_cpu_model_register_props(obj);
>>  #if !defined(CONFIG_USER_ONLY)
>> -    env->tod_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, s390x_tod_timer, cpu);
>> -    env->cpu_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, s390x_cpu_timer, cpu);
>> +    cpu->env.tod_timer =
>> +        timer_new_ns(QEMU_CLOCK_VIRTUAL, s390x_tod_timer, cpu);
>> +    cpu->env.cpu_timer =
>> +        timer_new_ns(QEMU_CLOCK_VIRTUAL, s390x_cpu_timer, cpu);
>>      s390_cpu_set_state(S390_CPU_STATE_STOPPED, cpu);
>>  #endif
> 
> I would have left the local variable so that we didn't
> need to change these lines, but whatever.

Then the variable is unused for CONFIG_USER_ONLY.
It's easier to suppress the warning by propagating.


r~



reply via email to

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