From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yuanhan Liu Subject: Re: [PATCH 4/4] vhost: define callfd and kickfd as int type Date: Wed, 9 Sep 2015 10:52:46 +0800 Message-ID: <20150909025246.GE2925@yliu-dev.sh.intel.com> References: <1440388485-13554-1-git-send-email-yuanhan.liu@linux.intel.com> <1440388485-13554-4-git-send-email-yuanhan.liu@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: "dev@dpdk.org" To: "Ouyang, Changchun" Return-path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 09D898DB4 for ; Wed, 9 Sep 2015 04:49:34 +0200 (CEST) Content-Disposition: inline In-Reply-To: List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Wed, Sep 09, 2015 at 02:41:37AM +0000, Ouyang, Changchun wrote: > > > > -----Original Message----- > > From: Yuanhan Liu [mailto:yuanhan.liu@linux.intel.com] > > Sent: Monday, August 24, 2015 11:55 AM > > To: dev@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 > > --- > > 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