On Fri, Jun 21, 2019 at 03:48:36PM +0200, Marc-André Lureau wrote: > On Fri, Jun 21, 2019 at 11:40 AM Stefan Hajnoczi <stefa...@redhat.com> wrote: > > diff --git a/contrib/vhost-user-blk/vhost-user-blk.c > > b/contrib/vhost-user-blk/vhost-user-blk.c > > index 86a3987744..ae61034656 100644 > > --- a/contrib/vhost-user-blk/vhost-user-blk.c > > +++ b/contrib/vhost-user-blk/vhost-user-blk.c > > @@ -25,6 +25,10 @@ > > #include <sys/ioctl.h> > > #endif > > > > +enum { > > + VHOST_USER_BLK_MAX_QUEUES = 8, > > +}; > > why do you use enum,(and not const int) ? (similarly for other devices) > > other than than > Reviewed-by: Marc-André Lureau <marcandre.lur...@redhat.com>
This is how I was taught when I was a little boy. With an actual variable there's a risk that the compiler reserves space for a variable when you actually just need a constant. Whether modern compilers do that or not, I don't know. The type is clearer when a variable is used instead of an enum. Pros and cons... Stefan
signature.asc
Description: PGP signature