[PATCH v7] eal: add bus cleanup to eal cleanup

Bruce Richardson bruce.richardson at intel.com
Fri Jun 3 17:39:16 CEST 2022


On Fri, Jun 03, 2022 at 08:11:54AM -0700, Stephen Hemminger wrote:
> On Fri,  3 Jun 2022 15:36:01 +0100
> Kevin Laatz <kevin.laatz at intel.com> wrote:
> 
> > +/* Clean up all devices of all buses */
> > +int
> > +eal_bus_cleanup(void)
> > +{
> > +	int ret = 0;
> > +	struct rte_bus *bus;
> > +
> > +	TAILQ_FOREACH(bus, &rte_bus_list, next) {
> > +		if (bus->cleanup == NULL)
> > +			continue;
> > +		if (bus->cleanup() != 0)
> > +			ret = -1;
> > +	}
> > +
> > +	return ret;
> > +}
> > +
> 
> This is an internal  function, and all users of it
> look like they don't use the return value.
> 
> Why not make the function void eal_bus_cleanup()
> and simplify back up the call chain?

Is there really that much difference in doing so? My own slight preference
would be to have the error codes available for future use in case we want
them, so long as the overhead of them is not great (which it should not
be). However, if others all feel that having these functions return void is
best, I'm happy enough with that too.


More information about the dev mailing list