From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 5FC762B96 for ; Wed, 7 Dec 2016 08:42:21 +0100 (CET) Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga105.jf.intel.com with ESMTP; 06 Dec 2016 23:42:20 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,310,1477983600"; d="scan'208";a="39680539" Received: from yliu-dev.sh.intel.com (HELO yliu-dev) ([10.239.67.162]) by orsmga005.jf.intel.com with ESMTP; 06 Dec 2016 23:42:19 -0800 Date: Wed, 7 Dec 2016 15:43:04 +0800 From: Yuanhan Liu To: Jan Wickbom Cc: "huawei.xie@intel.com" , "dev@dpdk.org" , Patrik Andersson R Message-ID: <20161207074304.GB31182@yliu-dev.sh.intel.com> References: <1480606010-6132-1-git-send-email-jan.wickbom@ericsson.com> <20161206065633.GQ24403@yliu-dev.sh.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Subject: Re: [dpdk-dev] [PATCH] vhost: allow for many vhost user ports X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Dec 2016 07:42:22 -0000 On Tue, Dec 06, 2016 at 11:42:36AM +0000, Jan Wickbom wrote: > > > @@ -189,7 +206,7 @@ > > > pfdset->fd[i].fd = -1; > > > pfdset->fd[i].rcb = pfdset- > > >fd[i].wcb = NULL; > > > pfdset->fd[i].dat = NULL; > > > - pfdset->num--; > > > + (void) fdset_adjust_num(pfdset); > > > > Unncessary cast. > > I'd like to keep the cast. The function returns int and it's nice to show we deliberately > don't care. I know your point, but it's not needed. > No strong opinion though, but we should do the same everywhere. Please > see below. > > > > > > i = -1; > > > } > > > pthread_mutex_unlock(&pfdset->fd_mutex); > > > @@ -211,12 +228,12 @@ > > > > > > pfdset->fd[index].fd = -1; > > > pfdset->fd[index].rcb = pfdset->fd[index].wcb = NULL; > > > - pfdset->fd[index].dat = NULL; > > > - pfdset->num--; > > > + (void) fdset_adjust_num(pfdset); > > If we remove the cast above, we should remove this one as well. Yes. --yliu