[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] microbit_i2c: Fix coredump when dump-vmstate
From: |
Peng Liang |
Subject: |
Re: [PATCH] microbit_i2c: Fix coredump when dump-vmstate |
Date: |
Tue, 20 Oct 2020 20:07:36 +0800 |
User-agent: |
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.2.2 |
On 10/20/2020 7:27 PM, Philippe Mathieu-Daudé wrote:
> On 10/20/20 1:17 PM, Peng Liang wrote:
>> On 10/19/2020 6:35 PM, Philippe Mathieu-Daudé wrote:
>>> On 10/19/20 11:34 AM, Peng Liang wrote:
>>>> VMStateDescription.fields should be end with VMSTATE_END_OF_LIST().
>>>> However, microbit_i2c_vmstate doesn't follow it. Let's change it.
>>>
>>> It might be easy to add a Coccinelle script to avoid future errors.
>>>
>>> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
>>>
>>
>> I tried to add a Coccinelle script to add VMSTATE_END_OF_LIST() to the
>> end of VMStateDescription.fields. For those who are not defined as
>> compound literals, it works well. However, I cannot make it work for
>> those defined as compound literals. And Julia doesn't think compound
>> literals are supported currently[1]. So maybe currently it's hard to
>> check the error using Coccinelle :(
>
> Interesting.
>
>>
>> Thanks for my colleague Biaoxiang Ye, who wrote a shell script to find
>> the errors, I didn't find other similar errors.
>
> Thanks for giving it a try. We could commit and run the script
> in a gitlab-ci job to avoid such regressions.
>
The script will report all fields not defined as compound literals as
errors (the number is much smaller than that of all
VMStateDescription.fields).
--
Thanks,
Peng
Re: [PATCH] microbit_i2c: Fix coredump when dump-vmstate, Peter Maydell, 2020/10/20