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: Sven Schnelle
Subject: Re: [Qemu-devel] [PATCH 2/5] lsi: use enum type for s->waiting
Date: Tue, 5 Mar 2019 08:17:12 +0100
User-agent: Mutt/1.10.1 (2018-07-13)

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.

Otherwise thanks for reviewing.

Regards
Sven




reply via email to

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