qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 09/11] armv7m: Split systick out from NVIC


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH 09/11] armv7m: Split systick out from NVIC
Date: Fri, 24 Feb 2017 14:58:35 +0000

On 24 February 2017 at 14:29, Alex Bennée <address@hidden> wrote:
>
> Peter Maydell <address@hidden> writes:
>
>> The SysTick timer isn't really part of the NVIC proper;
>> we just modelled it that way back when we couldn't
>> easily have devices that only occupied a small chunk
>> of a memory region. Split it out into its own device.
>>
>> Signed-off-by: Peter Maydell <address@hidden>

>> +    default:
>> +        qemu_log_mask(LOG_GUEST_ERROR,
>> +                      "SysTick: Bad read offset 0x%" HWADDR_PRIx "\n", 
>> addr);
>> +        break;
>> +    }
>> +
>> +    trace_systick_read(addr, val, size);
>
> I'm getting the compiler complain:
>
> hw/timer/armv7m_systick.c: In function ‘systick_read’:
> hw/timer/armv7m_systick.c:81:14: error: ‘val’ may be used uninitialized in 
> this function [-Werror=maybe-uninitialized]
>      uint32_t val;
>               ^
> cc1: all warnings being treated as errors
>
> I suspect the trace function could pick up garbage if we take the
> GUEST_ERROR leg and default out....

Indeed, missing 'val = 0;' in the default case.

thanks
-- PMM



reply via email to

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