qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 09/10] hw/sd/pxa2xx_mmci: Convert to VMStateDesc


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH 09/10] hw/sd/pxa2xx_mmci: Convert to VMStateDescription
Date: Sun, 20 Dec 2015 17:17:25 +0000

On 19 December 2015 at 21:45, Peter Crosthwaite
<address@hidden> wrote:
> On Fri, Dec 11, 2015 at 04:37:10PM +0000, Peter Maydell wrote:
>> Convert the pxa2xx_mmci device from manual save/load
>> functions to a VMStateDescription structure.
>>
>> This is a migration compatibility break.

>> +static bool pxa2xx_mmci_vmstate_validate(void *opaque, int version_id)
>> +{
>> +    PXA2xxMMCIState *s = opaque;
>> +
>> +    return s->tx_start < sizeof(s->tx_fifo)
>> +        && s->rx_start < sizeof(s->rx_fifo)
>> +        && s->tx_len <= sizeof(s->tx_fifo)
>> +        && s->rx_len <= sizeof(s->rx_fifo)
>> +        && s->resp_len <= sizeof(s->resp_fifo);
>
>
> A nit, but I wonder if ARRAY_SIZE should be generally used in this case, as
> it is a little more self documenting and would make code identical to
> non-byte FIFOs.

Yes. In particular ARRAY_SIZE(s->resp_fifo) is correct
and sizeof(s->resp_fifo) is wrong because that array is uint16_t...

>> +}
>> +
>
> Extra blank.
>
>> +
>> +static const VMStateDescription vmstate_pxa2xx_mmci = {
>
> Is the registration in class_init missing?

Does seem to be...

thanks
-- PMM



reply via email to

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