[dpdk-dev] [PATCH v7 06/15] bus: add helper to find which bus holds a device

Bruce Richardson bruce.richardson at intel.com
Fri Jun 30 23:25:06 CEST 2017


On Fri, Jun 30, 2017 at 06:46:31PM +0200, Jan Blunck wrote:
> On Fri, Jun 30, 2017 at 11:16 AM, Thomas Monjalon <thomas at monjalon.net> wrote:
> > 29/06/2017 20:21, Jan Blunck:
> >> +static int
> >> +bus_find_device(const struct rte_bus *bus, const void *_dev)
> >> +{
> >> +     struct rte_device *dev;
> >> +
> >> +     dev = bus->find_device(NULL, cmp_rte_device, _dev);
> >> +     return !dev;
> >> +}
> >
> > The preferred code style is to make explicit the NULL comparisons:
> >         return dev == NULL;
> 
> Oh, interesting ... not a lot of C++ programmers around here I guess.
> 
> Does this mean you also want me to make integer tests explicit again 0?

Please do.


More information about the dev mailing list