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 <stephen@networkplumber.org>
This commit is contained in:
parent
657c713385
commit
c023dabc07
@ -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;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user