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~