From mboxrd@z Thu Jan 1 00:00:00 1970 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=G+carcqS2J5UX1DLJS/SWprnlUrhFadGe1klPQ965Ww=; b=AFr4YYcRp4b6Ct096KCOy6pKAgC7iL7fcQucW4sZfwyfjrIHxpGMWH3J9z+347emik 5VqVDtqvhHGI/09hWHAR6aNvTYQtPxLK1ZSP7xqfmM/KFFSWgXgrPcl7pWYsjIWot+ZI yAYQwXThq7sbNxPcshab5MViAo/nzIPptWKbUrPIKZ579NwYQtzZaKkLmWfq6L29AqSF OUV5SAQOFMTGMyVkmFo+4YtWGQt8eVG3KfS8g8fkx3X3gUw5VlIiVVVHbxe682HGXStR WpZyOexPc0wFZQ/2Tnd36uJIi5BNPFAbC0/4AJ+1YPx2Vemapey3QEIt98q6m+dKVPKa tlRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=G+carcqS2J5UX1DLJS/SWprnlUrhFadGe1klPQ965Ww=; b=bbAofu6mdqxdHFQYHciSVnW/wkFstGWl/dyCkhhB+SKU0XVLZxkO/UHV+4URo+pnES /661V+KjOvIc7KJNRY3w8tGxq/0XSMjXvBNIxJQXxff+L7kdvjU9uQXnfLg13JehJKK2 NV9uZehtuGqnVf/C2vbRTAfUlRoVS0VdBFWe1QsK6y66yMUsiWRUL8dmIlPjwqhgx/N8 Y/N4c8cX0nzlOFDNP5SvSyCtzhkDJLw+AzBBNT3u0QCPaQqvQ/cYHfXrTszCMx3dJshf mkZsXryN7X5k1LVPwnY1ucRnaGE7j4QOfPVYg/fT6lec3Osz+kd1DLni1dqSq3aW2zOa 3s+w== X-Gm-Message-State: AMCzsaVp3SJaEVrMPDPS4EbqLUZUTTgUHAQqUoKu1YWAzucuTjdzC1qu OfnC53WvEjewx4H/hrTOcOZuGw== X-Google-Smtp-Source: ABhQp+R+/Zu9r+HJ2nTh5d4ecn7LImuAzrJ9BTQGP0AtJAukzzoj9NVr9jG+SGu3odokXDZOMsti3Q== X-Received: by 10.46.67.25 with SMTP id q25mr467255lja.146.1509572246184; Wed, 01 Nov 2017 14:37:26 -0700 (PDT) Received: from shemminger-XPS-13-9360 (static-92-33-18-3.sme.bredbandsbolaget.se. [92.33.18.3]) by smtp.gmail.com with ESMTPSA id r84sm327095ljb.28.2017.11.01.14.37.24 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Nov 2017 14:37:25 -0700 (PDT) Date: Wed, 1 Nov 2017 22:36:59 +0100 From: Stephen Hemminger To: Jeff Guo 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 Message-ID: <20171101223659.17099312@shemminger-XPS-13-9360> In-Reply-To: <1509567405-27439-2-git-send-email-jia.guo@intel.com> 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 Subject: Re: [dpdk-dev] [PATCH v6 1/2] eal: add uevent monitor for hot plug 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, 01 Nov 2017 21:37:26 -0000 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; > +}