]> git.droids-corp.org - dpdk.git/blobdiff - lib/librte_eal/common/eal_common_bus.c
bus: simplify finding starting point
[dpdk.git] / lib / librte_eal / common / eal_common_bus.c
index 87b0c6e6fa036102140a2668d44edd2f0f32a86f..997009d2b8d0ee8354274f14edbe94bb9b295c18 100644 (file)
@@ -154,12 +154,10 @@ rte_bus_find(const struct rte_bus *start, rte_bus_cmp_t cmp,
             const void *data)
 {
        struct rte_bus *bus = NULL;
-       bool start_found = !start;
 
        TAILQ_FOREACH(bus, &rte_bus_list, next) {
-               if (!start_found) {
-                       if (bus == start)
-                               start_found = 1;
+               if (start && bus == start) {
+                       start = NULL; /* starting point found */
                        continue;
                }
                if (cmp(bus, data) == 0)