From c023dabc079ac7bf97cc945cf517589ab386ab17 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Wed, 5 Jul 2017 09:55:31 -0700 Subject: [PATCH] pci: remove unnecessary casts in address parsing 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 c817b4c395..7d9e1a99b9 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.20.1