[dpdk-dev] [PATCH 4/4] vhost: define callfd and kickfd as int type

Yuanhan Liu yuanhan.liu at linux.intel.com
Wed Sep 9 04:52:46 CEST 2015


On Wed, Sep 09, 2015 at 02:41:37AM +0000, Ouyang, Changchun wrote:
> 
> 
> > -----Original Message-----
> > From: Yuanhan Liu [mailto:yuanhan.liu at linux.intel.com]
> > Sent: Monday, August 24, 2015 11:55 AM
> > To: dev at dpdk.org
> > Cc: Xie, Huawei; Ouyang, Changchun; Yuanhan Liu
> > Subject: [PATCH 4/4] vhost: define callfd and kickfd as int type
> > 
> > So that we can remove the redundant (int) cast.
> > 
> > Signed-off-by: Yuanhan Liu <yuanhan.liu at linux.intel.com>
> > ---
> >  examples/vhost/main.c                         |  6 ++---
> >  lib/librte_vhost/rte_virtio_net.h             |  4 ++--
> >  lib/librte_vhost/vhost_rxtx.c                 |  6 ++---
> >  lib/librte_vhost/vhost_user/virtio-net-user.c | 16 +++++++-------
> >  lib/librte_vhost/virtio-net.c                 | 32 +++++++++++++--------------
> >  5 files changed, 32 insertions(+), 32 deletions(-)
> > 
> > diff --git a/examples/vhost/main.c b/examples/vhost/main.c index
> > 1b137b9..b090b25 100644
> > --- a/examples/vhost/main.c
> > +++ b/examples/vhost/main.c
> > @@ -1433,7 +1433,7 @@ put_desc_to_used_list_zcp(struct vhost_virtqueue
> > *vq, uint16_t desc_idx)
> > 
> >  	/* Kick the guest if necessary. */
> >  	if (!(vq->avail->flags & VRING_AVAIL_F_NO_INTERRUPT))
> > -		eventfd_write((int)vq->callfd, 1);
> > +		eventfd_write(vq->callfd, 1);
> 
> Don't we need type conversion for '1' to eventfd_t here?

Nope. See eventfd_write man page:

   int eventfd_read(int fd, eventfd_t *value);
   int eventfd_write(int fd, eventfd_t value);

	--yliu


More information about the dev mailing list