X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=graph.c;h=25e04eec5151a878f13ef96eca7aaad922d0df00;hp=146ed7b148d9c7594c0002be5cfff0884896c888;hb=d0db819d9c5abe904f85a3b21a95023fef007f20;hpb=bd10a0694df75c5ae0257ac2f6c8b51061859321 diff --git a/graph.c b/graph.c index 146ed7b1..25e04eec 100644 --- a/graph.c +++ b/graph.c @@ -716,7 +716,7 @@ void graph_add_label(struct graph *bg, const char *label) static void __graph_value_drop(struct graph_label *l, struct graph_value *v) { - flist_del(&v->list); + flist_del_init(&v->list); if (v->tooltip) free(v->tooltip); free(v->value); @@ -726,8 +726,6 @@ static void __graph_value_drop(struct graph_label *l, struct graph_value *v) static void graph_value_drop(struct graph_label *l, struct graph_value *v) { - struct flist_head *entry, *tmp; - /* * Find head, the guy that's on the prio tree */ @@ -741,11 +739,11 @@ static void graph_value_drop(struct graph_label *l, struct graph_value *v) /* * Free aliases */ - flist_for_each_safe(entry, tmp, &v->alias) { + while (!flist_empty(&v->alias)) { struct graph_value *a; - a = flist_entry(entry, struct graph_value, alias); - flist_del(&a->alias); + a = flist_entry(v->alias.next, struct graph_value, alias); + flist_del_init(&a->alias); __graph_value_drop(l, a); } @@ -1043,7 +1041,8 @@ const char *graph_find_tooltip(struct graph *g, int ix, int iy) /* * If we got matches in one label, don't check others. */ - break; + if (best) + break; } if (best)