File tree Expand file tree Collapse file tree 1 file changed +7
-11
lines changed Expand file tree Collapse file tree 1 file changed +7
-11
lines changed Original file line number Diff line number Diff line change @@ -63,20 +63,16 @@ static struct hashmap *bpf_map_hash;
63
63
static struct bpf_perf_object *
64
64
bpf_perf_object__next (struct bpf_perf_object * prev )
65
65
{
66
- struct bpf_perf_object * next ;
67
-
68
- if (!prev )
69
- next = list_first_entry (& bpf_objects_list ,
70
- struct bpf_perf_object ,
71
- list );
72
- else
73
- next = list_next_entry (prev , list );
66
+ if (!prev ) {
67
+ if (list_empty (& bpf_objects_list ))
68
+ return NULL ;
74
69
75
- /* Empty list is noticed here so don't need checking on entry. */
76
- if (& next -> list == & bpf_objects_list )
70
+ return list_first_entry (& bpf_objects_list , struct bpf_perf_object , list );
71
+ }
72
+ if (list_is_last (& prev -> list , & bpf_objects_list ))
77
73
return NULL ;
78
74
79
- return next ;
75
+ return list_next_entry ( prev , list ) ;
80
76
}
81
77
82
78
#define bpf_perf_object__for_each (perf_obj , tmp ) \
You can’t perform that action at this time.
0 commit comments