From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: [PATCH v6 1/2] eal: add uevent monitor for hot plug Date: Wed, 1 Nov 2017 22:36:59 +0100 Message-ID: <20171101223659.17099312@shemminger-XPS-13-9360> References: <1505880732-16539-3-git-send-email-jia.guo@intel.com> <1509567405-27439-1-git-send-email-jia.guo@intel.com> <1509567405-27439-2-git-send-email-jia.guo@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: bruce.richardson@intel.com, ferruh.yigit@intel.com, gaetan.rivet@6wind.com, thomas@monjalon.net, konstantin.ananyev@intel.com, jblunck@infradead.org, shreyansh.jain@nxp.com, jingjing.wu@intel.com, dev@dpdk.org, helin.zhang@intel.com To: Jeff Guo Return-path: Received: from mail-lf0-f66.google.com (mail-lf0-f66.google.com [209.85.215.66]) by dpdk.org (Postfix) with ESMTP id A859C1B34F for ; Wed, 1 Nov 2017 22:37:26 +0100 (CET) Received: by mail-lf0-f66.google.com with SMTP id 75so4110056lfx.1 for ; Wed, 01 Nov 2017 14:37:26 -0700 (PDT) In-Reply-To: <1509567405-27439-2-git-send-email-jia.guo@intel.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Thu, 2 Nov 2017 04:16:44 +0800 Jeff Guo wrote: > > +/* Map pci device */ > +int > +rte_pci_remap_device(struct rte_pci_device *dev) > +{ > + int ret = -1; Please don't always initialize variables. It is unnecessary, and with modern compilers a bad habit since it defeats the uninitailized variable warning message which is useful to detect buggy code paths. > + > + if (dev == NULL) > + return -EINVAL; > + > + switch (dev->kdrv) { > + case RTE_KDRV_NIC_UIO: > + ret = pci_uio_remap_resource(dev); > + break; > + default: > + RTE_LOG(DEBUG, EAL, > + " Not managed by a supported kernel driver, skipped\n"); > + ret = 1; > + break; > + } > + > + return ret; > +}