qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 2/5] lsi: use enum type for s->waiting


From: Philippe Mathieu-Daudé
Subject: Re: [Qemu-devel] [PATCH 2/5] lsi: use enum type for s->waiting
Date: Tue, 5 Mar 2019 13:07:52 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1

On 3/5/19 8:17 AM, Sven Schnelle wrote:
> Hi Philippe,
> 
> On Tue, Mar 05, 2019 at 12:18:01AM +0100, Philippe Mathieu-Daudé wrote:
>>>  
>>> +enum {
>>> +    LSI_NOWAIT,
>>
>> You forgot the comment for NOWAIT.
> 
> I thought LSI_NOWAIT is self-explaining, but will add that.
> 
>>>      int waiting;
>>
>> When a field is not used by migration, you can declare it as enum:
>>
>>        enum {
>>            LSI_NOWAIT = 0, /* SCRIPTS are running or stopped */
>>            LSI_WAIT_RESELECT = 1, /* Wait Reselect instruction has been
>> issued */
>>            LSI_DMA_SCRIPTS = 2, /* processing DMA from lsi_execute_script */
>>            LSI_DMA_IN_PROGRESS = 3, /* DMA operation is in progress */
>>        } waiting;
>>
>> This gives hints to the compiler about values to check.
> 
> But it is used by migration, so this doesn't apply here? I had a typedef enum 
> before,
> but this doesn't compile.

Oh you are right, I didn't check... So with the updated comment:
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>

> 
> Otherwise thanks for reviewing.
> 
> Regards
> Sven
> 
> 



reply via email to

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