pci: make rte_pci_probe void
PATCH 1/1 pci: make rte_pci_probe void
Since rte_pci_probe always returns 0 or exits via rte_exit() there is no point in having it return a value.
Just make it void
--- lib/librte_eal/bsdapp/eal/eal.c | 3 +-- lib/librte_eal/common/eal_common_pci.c | 9 +++------ lib/librte_eal/common/include/rte_pci.h | 6 +----- lib/librte_eal/linuxapp/eal/eal.c | 3 +-- 4 files changed, 6 insertions(+), 15 deletions(-)
lib/librte_eal/bsdapp/eal/eal.c +1 -2
@@ -551,8 +551,7 @@ rte_eal_init(int argc, char **argv)rte_eal_mp_wait_lcore ();/* Probe & Initialize PCI devices */ -if (rte_eal_pci_probe ()) -rte_panic ("Cannot probe PCI\n" ); +rte_eal_pci_probe ();return fctret; }
lib/librte_eal/common/eal_common_pci.c +3 -6
@@ -223,13 +223,13 @@ err_return:* all registered drivers that have a matching entry in its id_table * for discovered devices. */ -int +void rte_eal_pci_probe (void ) {struct rte_pci_device *dev =NULL ;struct rte_devargs *devargs;int probe_all =0 ; -int ret =0 ; +int ret;if (rte_eal_devargs_type_count (RTE_DEVTYPE_WHITELISTED_PCI ) ==0 ) probe_all =1 ;
@@ -252,12 +252,10 @@ rte_eal_pci_probe(void)" cannot be used\n" , dev->addr.domain, dev->addr.bus, dev->addr.devid, dev->addr.function); } - -return 0 ; }/* dump one device */ -static int +static void pci_dump_one_device (FILE *f,struct rte_pci_device *dev) {int i;
@@ -273,7 +271,6 @@ pci_dump_one_device(FILE *f, struct rte_pci_device *dev) dev->mem_resource[i].phys_addr, dev->mem_resource[i].len); } -return 0 ; }/* dump devices on the bus */
lib/librte_eal/common/include/rte_pci.h +1 -5
@@ -327,12 +327,8 @@ int rte_eal_pci_scan(void);* Scan the content of the PCI bus, and call the probe() function for * all registered drivers that have a matching entry in its id_table * for discovered devices. -* -* @return -* - 0 on success. -* - Negative on error. */ -int rte_eal_pci_probe (void ); +void rte_eal_pci_probe (void );#ifdef RTE_LIBRTE_EAL_HOTPLUG /**
lib/librte_eal/linuxapp/eal/eal.c +1 -2
@@ -842,8 +842,7 @@ rte_eal_init(int argc, char **argv)rte_eal_mp_wait_lcore ();/* Probe & Initialize PCI devices */ -if (rte_eal_pci_probe ()) -rte_panic ("Cannot probe PCI\n" ); +rte_eal_pci_probe ();return fctret; }
Signature · 1 line
2.1.4
A message that is not in the archive (sent off-list or not yet received): 1429034136-13482-1-git-send-email-stephen-OTpzqLSitTUnbdJkjeBofR2eb7JE58TQ@public.gmane.org
2015-04-14 10:55, Stephen Hemminger:
Quoted 6 lines
Since
rte_pci_probealways returns 0 or exits viarte_exit()there is no point in having it return a value.Just make it void
Signed-off-by Stephen Hemminger <[email protected]>
Seems partially superseded by this patch:
http://dpdk.org/dev/patchwork/patch/4347/
Quoted 11 lines · On Mon, 20 Apr 2015 15:15:36 +0200 Thomas Monjalon <[email protected]>…
2015-04-14 10:55, Stephen Hemminger:
Quoted 6 lines
Since
rte_pci_probealways returns 0 or exits viarte_exit()there is no point in having it return a value.Just make it void
Signed-off-by Stephen Hemminger <[email protected]>Seems partially superseded by this patch:
http://dpdk.org/dev/patchwork/patch/4347/
The patch could be redone, but it would break ABI for no good reason. Just drop it.