[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
>
>
- [Qemu-devel] [PATCH 1/5] lsi: use ldn_le_p()/stn_le_p(), Sven Schnelle, 2019/03/04
- [Qemu-devel] [PATCH 3/5] lsi: use enum type for s->msg_action, Sven Schnelle, 2019/03/04
- [Qemu-devel] [PATCH 5/5] lsi: return dfifo value, Sven Schnelle, 2019/03/04
- [Qemu-devel] [PATCH 4/5] lsi: use SCSI phase names instead of numbers in trace, Sven Schnelle, 2019/03/04
- Re: [Qemu-devel] [PATCH 1/5] lsi: use ldn_le_p()/stn_le_p(), Eric Blake, 2019/03/04
- Re: [Qemu-devel] [PATCH 1/5] lsi: use ldn_le_p()/stn_le_p(), Philippe Mathieu-Daudé, 2019/03/04