From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <stephen@networkplumber.org>
Received: from mail-pf0-f179.google.com (mail-pf0-f179.google.com
 [209.85.192.179]) by dpdk.org (Postfix) with ESMTP id 4A52E7CFC
 for <dev@dpdk.org>; Wed, 21 Jun 2017 18:35:54 +0200 (CEST)
Received: by mail-pf0-f179.google.com with SMTP id q86so3328122pfl.3
 for <dev@dpdk.org>; Wed, 21 Jun 2017 09:35:54 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=networkplumber-org.20150623.gappssmtp.com; s=20150623;
 h=from:to:cc:subject:date:message-id:in-reply-to:references;
 bh=M6XvBbIJSgEjgxOO7LRGvJhM5KN47ONkap+60bnbKiY=;
 b=t/lQU7nZmqCtD2LUKuC1AfTGsHs8lK5zU71Sk5wHFRd2mstZYBUvouC4A5BLHmtIRw
 /hG7I+SRcmriOjiOtz/qdud3E5y8+Wksqny/jRgmsUpnzfsAKtfhXF8wS1JxjC91r4vx
 5M6L+vC3lEM3kpGc1J5Q0Si8F7538M/+UIHVgwGMLvYwG18uJPcHMGC5JCJoBk/SA1H7
 q6KFQqNcHZbkYunB+nCqcPIjpd9+kk1ZtcxQhX3CyeCIY2Tw6AdnfLKHRqUZUbSzDR6j
 FFxZ/jx7F4bcyKTr/Ix6fhohIHs3pvOiwy2vCYUl4C0PY0Juk6+Pacwst0V1Nt74elrV
 qZtQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to
 :references;
 bh=M6XvBbIJSgEjgxOO7LRGvJhM5KN47ONkap+60bnbKiY=;
 b=Z80q4rgThUFYcp/UlJRvjQiXtIH8sol3LHRwPFVI2Gi0OoZBsqg7XB00hSN0szQYLe
 e9ip0QqPBxFWNYv3vhuegf5KYgUNt0uGwfrYgx1rAQ7VIp3ODBcAiZ/esJ/7DwkL+OIY
 gx/1E8iFaSgXdd1hRBbnT4e0vKCv/hA/bEGSh8DhRQwHKDhRemRur2B8r4DwHoGKJug9
 sIPNJSfVrmk5bsb27V4RQcHd3IGboBSIuq9q7A64yFj4l8qqnRnxsvDwYGQ9TkDgZHB6
 g+zM3zyJ+6ygjkgJ4YxpdzvBH73jCAg2NiadH4FDYbEL6MSFec0Or6L42baPee3b3BaS
 odBw==
X-Gm-Message-State: AKS2vOyrPXSpNXfU1SFCNghNSKOfMIwdmkK0rRPAnzl/bLj7IfLN98fl
 b/HJvTL4PmGOTKfWo+4Fzg==
X-Received: by 10.99.0.212 with SMTP id 203mr37657405pga.259.1498062953948;
 Wed, 21 Jun 2017 09:35:53 -0700 (PDT)
Received: from xeon-e3.wavecable.com (76-14-207-240.or.wavecable.com.
 [76.14.207.240])
 by smtp.gmail.com with ESMTPSA id k73sm38355884pge.13.2017.06.21.09.35.52
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Wed, 21 Jun 2017 09:35:53 -0700 (PDT)
From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Stephen Hemminger <stephen@networkplumber.org>,
 Stephen Hemminger <sthemmin@microsoft.com>
Date: Wed, 21 Jun 2017 09:35:43 -0700
Message-Id: <20170621163545.25713-2-stephen@networkplumber.org>
X-Mailer: git-send-email 2.11.0
In-Reply-To: <20170621163545.25713-1-stephen@networkplumber.org>
References: <20170621163545.25713-1-stephen@networkplumber.org>
Subject: [dpdk-dev] [PATCH 1/3] pci: remove unnecessary casts from strtoul
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <http://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <http://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Wed, 21 Jun 2017 16:35:56 -0000

The function strtoul returns unsigned long and can be directly
assigned to a smaller type. Removing the casts allows easier
expansion of PCI domain.

Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
---
 lib/librte_eal/linuxapp/eal/eal_pci.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/librte_eal/linuxapp/eal/eal_pci.c b/lib/librte_eal/linuxapp/eal/eal_pci.c
index 595622b2129f..cfd3a8e92839 100644
--- a/lib/librte_eal/linuxapp/eal/eal_pci.c
+++ b/lib/librte_eal/linuxapp/eal/eal_pci.c
@@ -430,10 +430,10 @@ parse_pci_addr_format(const char *buf, int bufsize, struct rte_pci_addr *addr)
 
 	/* now convert to int values */
 	errno = 0;
-	addr->domain = (uint16_t)strtoul(splitaddr.domain, NULL, 16);
-	addr->bus = (uint8_t)strtoul(splitaddr.bus, NULL, 16);
-	addr->devid = (uint8_t)strtoul(splitaddr.devid, NULL, 16);
-	addr->function = (uint8_t)strtoul(splitaddr.function, NULL, 10);
+	addr->domain = strtoul(splitaddr.domain, NULL, 16);
+	addr->bus = strtoul(splitaddr.bus, NULL, 16);
+	addr->devid = strtoul(splitaddr.devid, NULL, 16);
+	addr->function = strtoul(splitaddr.function, NULL, 10);
 	if (errno != 0)
 		goto error;
 
-- 
2.11.0