From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Stephen Hemminger <stephen@networkplumber.org>,
Stephen Hemminger <sthemmin@microsoft.com>
Subject: [dpdk-dev] [PATCH v2 1/3] pci: remove unnecessary casts from strtoul
Date: Thu, 22 Jun 2017 08:56:39 -0700 [thread overview]
Message-ID: <20170622155641.25916-2-stephen@networkplumber.org> (raw)
In-Reply-To: <20170622155641.25916-1-stephen@networkplumber.org>
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
next prev parent reply other threads:[~2017-06-22 15:56 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-22 15:56 [dpdk-dev] [PATCH v2 0/3] 32 bit PCI domain support Stephen Hemminger
2017-06-22 15:56 ` Stephen Hemminger [this message]
2017-06-22 15:56 ` [dpdk-dev] [PATCH v2 2/3] eal: PCI domain should be 32 bits Stephen Hemminger
2017-06-22 16:05 ` Thomas Monjalon
2017-06-22 16:23 ` Stephen Hemminger
2017-06-22 15:56 ` [dpdk-dev] [PATCH v2 3/3] mlx5: handle 32 bit PCI domain Stephen Hemminger
2017-06-22 16:17 ` Thomas Monjalon
2017-06-22 16:41 ` Stephen Hemminger
2017-06-22 16:42 ` Stephen Hemminger
2017-06-22 17:04 ` Thomas Monjalon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170622155641.25916-2-stephen@networkplumber.org \
--to=stephen@networkplumber.org \
--cc=dev@dpdk.org \
--cc=sthemmin@microsoft.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).