From patchwork Thu Apr 16 23:23:40 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 4341 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 5C9B0C36A; Fri, 17 Apr 2015 01:23:42 +0200 (CEST) Received: from mail-pa0-f47.google.com (mail-pa0-f47.google.com [209.85.220.47]) by dpdk.org (Postfix) with ESMTP id 62D5DC352 for ; Fri, 17 Apr 2015 01:23:39 +0200 (CEST) Received: by pabsx10 with SMTP id sx10so105254040pab.3 for ; Thu, 16 Apr 2015 16:23:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=wWp7GCRZqsxE4T1o65R2Sm1EcpsdQJnGiCOS4IumAzw=; b=JPzPJ4FbBJ4aLX28SKVCsyDRsKt0ty/96E68XpmF0pk2X+U/3H0jBLblOEwcohE8Pm ERhyKbPXZAYpd1RXFGjuaffiyMnJVkLXyc5iDxgmTBDKUUFGyHes+1+2/lyn+LuMAPAY Rv6bNLmcSCFnNsmEdM5Bu81JcMBUChE4w4h5fShYbPxslWWnE/qYgdY0drfP5CTqVirn O1mTQlA0KXAovmr1QVN9T2CATBZDmNgShOHVNiYLJsMLBsHxiy3SvtwKLAUZ9YSlto6D bZyztWBQUK9NgzSfutaUmiJiuHcv6kIIygBbUHSYv6TbGODWSe+r+DvLyCcR6sWKUF/9 EefQ== X-Gm-Message-State: ALoCoQlTKVX1OtYPhfmvVO1gPkTOCtWY8khgeXUJzVz73UOYQD/sawevdzHHBaxxfUP1TN0toS7l X-Received: by 10.66.217.129 with SMTP id oy1mr346055pac.82.1429226618744; Thu, 16 Apr 2015 16:23:38 -0700 (PDT) Received: from urahara.home.lan (static-50-53-82-155.bvtn.or.frontiernet.net. [50.53.82.155]) by mx.google.com with ESMTPSA id gy3sm8163808pbb.42.2015.04.16.16.23.37 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 16 Apr 2015 16:23:38 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Date: Thu, 16 Apr 2015 16:23:40 -0700 Message-Id: <1429226620-9847-3-git-send-email-stephen@networkplumber.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1429226620-9847-1-git-send-email-stephen@networkplumber.org> References: <1429226620-9847-1-git-send-email-stephen@networkplumber.org> Subject: [dpdk-dev] [PATCH 2/2] pci: allow const for rte_pci_addr X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" probe and close both don't modify the rte_pci_addr structure that is passed. Signed-off-by: Stephen Hemminger --- lib/librte_eal/common/eal_common_pci.c | 4 ++-- lib/librte_eal/common/include/rte_pci.h | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/librte_eal/common/eal_common_pci.c b/lib/librte_eal/common/eal_common_pci.c index 808b87b..4229aaf 100644 --- a/lib/librte_eal/common/eal_common_pci.c +++ b/lib/librte_eal/common/eal_common_pci.c @@ -158,7 +158,7 @@ pci_close_all_drivers(struct rte_pci_device *dev) * the driver of the devive. */ int -rte_eal_pci_probe_one(struct rte_pci_addr *addr) +rte_eal_pci_probe_one(const struct rte_pci_addr *addr) { struct rte_pci_device *dev = NULL; int ret = 0; @@ -189,7 +189,7 @@ err_return: * the driver of the devive. */ int -rte_eal_pci_close_one(struct rte_pci_addr *addr) +rte_eal_pci_close_one(const struct rte_pci_addr *addr) { struct rte_pci_device *dev = NULL; int ret = 0; diff --git a/lib/librte_eal/common/include/rte_pci.h b/lib/librte_eal/common/include/rte_pci.h index 62449d7..223d3cd 100644 --- a/lib/librte_eal/common/include/rte_pci.h +++ b/lib/librte_eal/common/include/rte_pci.h @@ -292,7 +292,8 @@ eal_parse_pci_DomBDF(const char *input, struct rte_pci_addr *dev_addr) * Negative on addr is less than addr2, or error. */ static inline int -rte_eal_compare_pci_addr(struct rte_pci_addr *addr, struct rte_pci_addr *addr2) +rte_eal_compare_pci_addr(const struct rte_pci_addr *addr, + const struct rte_pci_addr *addr2) { uint64_t dev_addr, dev_addr2; @@ -348,7 +349,7 @@ int rte_eal_pci_probe(void); * - 0 on success. * - Negative on error. */ -int rte_eal_pci_probe_one(struct rte_pci_addr *addr); +int rte_eal_pci_probe_one(const struct rte_pci_addr *addr); /** * Close the single PCI device. @@ -363,7 +364,7 @@ int rte_eal_pci_probe_one(struct rte_pci_addr *addr); * - 0 on success. * - Negative on error. */ -int rte_eal_pci_close_one(struct rte_pci_addr *addr); +int rte_eal_pci_close_one(const struct rte_pci_addr *addr); #endif /* RTE_LIBRTE_EAL_HOTPLUG */ /**