From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id 80557282 for ; Mon, 6 Feb 2017 03:52:09 +0100 (CET) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga105.fm.intel.com with ESMTP; 05 Feb 2017 18:52:08 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,340,1477983600"; d="scan'208";a="1103469313" Received: from debian.sh.intel.com (HELO debian) ([10.239.67.170]) by fmsmga001.fm.intel.com with ESMTP; 05 Feb 2017 18:52:07 -0800 Date: Mon, 6 Feb 2017 10:51:08 +0800 From: Tiwei Bie To: "Lu, Wenzhuo" Cc: "dev@dpdk.org" Message-ID: <20170206025108.GA901@debian> References: <1485311962-62335-1-git-send-email-wenzhuo.lu@intel.com> <1486346972-30710-1-git-send-email-wenzhuo.lu@intel.com> <20170206023030.GA21315@debian> <6A0DE07E22DDAD4C9103DF62FEBC09093B5613B8@shsmsx102.ccr.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <6A0DE07E22DDAD4C9103DF62FEBC09093B5613B8@shsmsx102.ccr.corp.intel.com> User-Agent: Mutt/1.7.2 (2016-11-26) Subject: Re: [dpdk-dev] [PATCH v2] net/ixgbe: clean up rte_eth_dev_info_get 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: Mon, 06 Feb 2017 02:52:09 -0000 On Mon, Feb 06, 2017 at 10:41:28AM +0800, Lu, Wenzhuo wrote: > Hi Tiwei, > > > -----Original Message----- > > From: Bie, Tiwei > > Sent: Monday, February 6, 2017 10:31 AM > > To: Lu, Wenzhuo > > Cc: dev@dpdk.org > > Subject: Re: [dpdk-dev] [PATCH v2] net/ixgbe: clean up rte_eth_dev_info_get > > > > On Mon, Feb 06, 2017 at 10:09:32AM +0800, Wenzhuo Lu wrote: > > [...] > > > static void ixgbe_dcb_init(struct ixgbe_hw *hw, struct > > > ixgbe_dcb_config *dcb_config); -static int is_ixgbe_pmd(const char > > > *driver_name); > > > +static int is_device_supported(struct rte_eth_dev *dev, struct > > > +eth_driver *drv); > > > > > > > Should be: > > static bool is_device_supported(struct rte_eth_dev *dev, struct eth_driver > > *drv); > O, forget to change it. Thanks. > > > > > > /* For Virtual Function support */ > > > static int eth_ixgbevf_dev_init(struct rte_eth_dev *eth_dev); @@ > > > -4380,16 +4380,14 @@ static int > > ixgbevf_dev_xstats_get_names(__rte_unused struct rte_eth_dev *dev, > > > ixgbe_add_rar(dev, addr, 0, 0); > > > } > > > > > > -static int > > > -is_ixgbe_pmd(const char *driver_name) > > > +static bool > > > +is_device_supported(struct rte_eth_dev *dev, struct eth_driver *drv) > > > { > > > - if (!strstr(driver_name, "ixgbe")) > > > - return -ENOTSUP; > > > + if (strcmp(dev->driver->pci_drv.driver.name, > > > + drv->pci_drv.driver.name)) > > > + return FALSE; > > > > > > > It would be better to use `false' instead of `FALSE'. > I see both 'false' and 'FALSE' are defined and used. Is there any reason that 'false' is better? > I think `true' and `false' are standard keywords defined and reserved by C. So I think it would be better to use them if the return type is `bool'. Best regards, Tiwei Bie