]> git.itanic.dy.fi Git - scan-pagemap/blobdiff - analyze.c
Correct the usage of linked lists
[scan-pagemap] / analyze.c
index dda98bb5fd97ce1825355448296e898abcf3a7cc..18e95c49fba977f26928d20f13b155be082abd7c 100644 (file)
--- a/analyze.c
+++ b/analyze.c
@@ -41,14 +41,10 @@ static void count_pages(struct bintree *b, struct bintree_ops *ops)
        struct maps_list *ml;
 
        if (af->pid) {
-               if (!pf->ml)
+               if (list_empty(&pf->ml.list)) {
                        return;
-               if (list_empty(&pf->ml->list)) {
-                       ml = list_to_maps_list(&pf->ml->list);
-                       if (ml->map->pid == af->pid)
-                               goto get_stats;
                }
-               list_for_each_entry(ml, &pf->ml->list, list) {
+               list_for_each_entry(ml, &pf->ml.list, list) {
                        if (ml->map->pid == af->pid)
                                goto get_stats;
                }