[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
- [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