From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg0-f54.google.com (mail-pg0-f54.google.com [74.125.83.54]) by dpdk.org (Postfix) with ESMTP id 675525A98 for ; Thu, 22 Jun 2017 17:56:51 +0200 (CEST) Received: by mail-pg0-f54.google.com with SMTP id 132so9519864pgb.2 for ; Thu, 22 Jun 2017 08:56:51 -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=v7ABclBt6Yozva1590n/4tRvZ6kKU8lKbrBhnScuMKkRQC32+nU/O5SbJ2+DD9bK1T vp5XvbnhhklpoF+Up7URMLr9yUbRvRzBxc+Nrk/hTUhK7Zg0O4bM5tlYpnzjQgHp1YAT i31rzfO9B+bo2p0wWGyhg7if1ZRk3x1+B68b2EG60kn0JPRIOSKQV+tZ85VcPeoXEeOx 13kulgaczzXbn9WURkFsklO/TdrhbWM+KIB1n29fRhL1dtELPDNYieDcsBkmnHzoidOG gbcJ3vWz172gWPZuzGr4xAdpO5vbm2D4kZoR4GeC5u8Y/zgIa8HLwbj99RHrTf+REORA PGoA== 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=gjM3Zc0tP3Ne6O3uXz2yprPuWa6La4B8BMmBAlxxDJAkM7cVBelyts/1OMVW0xvM0z 6lYM70S5Ax47H1S1hi5i7iVzlya0H1Q7QwWkrs+5F8OWJ4YB3rM8NJqnCReUbpigvm1H Of0rweetWkuvvHM2H2uSWohAbC3UeP2X3K/SLbJCgOa1RGSWg/SRr9TY5HrKbJnWuz6V ulTjFGSVdjo11NoEKFia5G/fxv+AATC7520Ey82OL1t/maGJDjTSmQPmxGmdhn/wWxz/ SXTmdeV4/nNgP16PFYLes2lRjshVEHUHNSHn5zHo9Yxdc1513hbEw1S59vDXCjsdy0ef h3Vw== X-Gm-Message-State: AKS2vOwFO8AGJWlNWBL8K7vxyxi1a+M9HhRliI5SwKDKW9SSz0sY1PkH lzHDuwqFk+geGbxYYmGlPg== X-Received: by 10.84.232.13 with SMTP id h13mr3720691plk.278.1498147010061; Thu, 22 Jun 2017 08:56:50 -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 y28sm4678939pfd.32.2017.06.22.08.56.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 22 Jun 2017 08:56:49 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Stephen Hemminger Date: Thu, 22 Jun 2017 08:56:39 -0700 Message-Id: <20170622155641.25916-2-stephen@networkplumber.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170622155641.25916-1-stephen@networkplumber.org> References: <20170622155641.25916-1-stephen@networkplumber.org> Subject: [dpdk-dev] [PATCH v2 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jun 2017 15:56:51 -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 --- 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