From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf0-f176.google.com (mail-pf0-f176.google.com [209.85.192.176]) by dpdk.org (Postfix) with ESMTP id 64C6B2C13 for ; Wed, 5 Jul 2017 18:55:43 +0200 (CEST) Received: by mail-pf0-f176.google.com with SMTP id c73so132513711pfk.2 for ; Wed, 05 Jul 2017 09:55:43 -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=IW1SHmB/eSYYUA6S9qRTgDySTuT/JhBEH2rrYLsug0Y=; b=KahpCP2e7KDgUF2wg9KwPTn0cSidz07Tt4FUtx0bxj8ewz9bfm6KD9deLJFVUeJJVz Zh3lqnuuJMgLAnzi+xxEUqbSnUGtczwhrysm2Mvfwn3i8biCLECVQg9d8ALR/DvOOBIe o5TqTtPn4WAvQA4dGXtOWKG44YMTKThEEuAlwcPnFphDsubcjgGTRR+o7HDIxgIH6AxD QxhrCKSvWorXTDAKQXp80UokyOQ8sNpScB3OBDS6FG6ECWzDFx3lD9H1Kk6bOpGj4jBq yH4+P8pwKM+nPVAenwBVMkjA380xh2RGt8KemZLLTmtVxAHuDtAj8qbPAzVLFvuiaETu bfTw== 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=IW1SHmB/eSYYUA6S9qRTgDySTuT/JhBEH2rrYLsug0Y=; b=JdIQ4pVABod933Bma+Fkg+Tm9WBIe1hzyn/M290lEcHQAEnFtvc4DF5LKJVoCBJG2C VzaT7YJvemx4dCB0hoRyDb48kBIlrm5uP9uV8+nkGg/hk2J6O6fmRHayuDzpVmgBbh/M k6I5T1D1Hejk4KEav5e8epa+3/2HDvAyJyiRKFYcg/kohbUJxaw3tniaUNwChaVJisEt p1ZN9Kr8sjHLFM9je+ROcwKVBhFAmrQ4e9filxnPZ/LfM3bjErHu2QXKKdB/X5nvpB1k jXQwQtaEuGxa7UOW2wpdV3c+nmTaQkvin9J9gg2hAxJdrhX4U6qBs0ePyqA5yhVj6HOa FpLg== X-Gm-Message-State: AIVw110FS0ZLnEwHXcZIuwlfCJx6/VIHV5Akp8l4D5kxUD24SjiIxo1v dX4dxctE8+zOzCXpKdyQPw== X-Received: by 10.99.101.135 with SMTP id z129mr21547996pgb.66.1499273742436; Wed, 05 Jul 2017 09:55:42 -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 o1sm47900914pgq.10.2017.07.05.09.55.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Jul 2017 09:55:41 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Stephen Hemminger Date: Wed, 5 Jul 2017 09:55:31 -0700 Message-Id: <20170705165533.20581-2-stephen@networkplumber.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170705165533.20581-1-stephen@networkplumber.org> References: <20170705165533.20581-1-stephen@networkplumber.org> Subject: [dpdk-dev] [PATCH v3 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: Wed, 05 Jul 2017 16:55:44 -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 c817b4c3954d..7d9e1a99b9c4 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