From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id 0A4D01B3C0; Wed, 26 Sep 2018 14:34:31 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Sep 2018 05:34:30 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,306,1534834800"; d="scan'208";a="265870541" Received: from aburakov-mobl1.ger.corp.intel.com (HELO [10.252.17.84]) ([10.252.17.84]) by fmsmga005.fm.intel.com with ESMTP; 26 Sep 2018 05:34:22 -0700 To: Darek Stojaczyk , dev@dpdk.org Cc: Alejandro Lucero , stable@dpdk.org, Dariusz Stojaczyk References: <20180917134643.103871-1-dariusz.stojaczyk@intel.com> <20180917134643.103871-2-dariusz.stojaczyk@intel.com> From: "Burakov, Anatoly" Message-ID: <26f73861-6fac-065e-b550-219a4c365bea@intel.com> Date: Wed, 26 Sep 2018 13:34:21 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20180917134643.103871-2-dariusz.stojaczyk@intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-stable] [PATCH 2/2] eal/vfio: cleanup getting group fd X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Sep 2018 12:34:32 -0000 On 17-Sep-18 2:46 PM, Darek Stojaczyk wrote: > From: Dariusz Stojaczyk > > Factor out duplicated code. > > Signed-off-by: Dariusz Stojaczyk > --- > + > +int > +rte_vfio_get_group_fd(int iommu_group_num) > +{ > + struct vfio_config *vfio_cfg; > + > + /* get the vfio_config it belongs to */ > + vfio_cfg = get_vfio_cfg_by_group_num(iommu_group_num); > + vfio_cfg = vfio_cfg ? vfio_cfg : default_vfio_cfg; I tend to prefer being explicit rather than implicit (i.e. 'vfio_cfg == NULL' instead of 'vfio_cfg'). Otherwise, Acked-by: Anatoly Burakov -- Thanks, Anatoly