bus: simplify finding starting point
[dpdk.git] / lib / librte_eal / common / eal_common_vdev.c
index baf3c5b..9ec62f4 100644 (file)
@@ -342,12 +342,10 @@ vdev_find_device(const struct rte_device *start, rte_dev_cmp_t cmp,
                 const void *data)
 {
        struct rte_vdev_device *dev;
-       bool start_found = !start;
 
        TAILQ_FOREACH(dev, &vdev_device_list, next) {
-               if (start_found == 0) {
-                       if (&dev->device == start)
-                               start_found = 1;
+               if (start && &dev->device == start) {
+                       start = NULL;
                        continue;
                }
                if (cmp(&dev->device, data) == 0)