Skip to contentSkip to conversation

samples: fix compile failure error

PATCH In review Ruijian Li 2 participants 2 messages May 21, 2022 – May 23, 2022

Subsystems (3)
lore
Share & tools
lore

Ruijian Li

author
#0 lore raw

PATCH 1/1 samples: fix compile failure error

Because compile samples/bpf/test_lru_dist failure, I remove the declaration of the struct list_head.

---
 samples/bpf/test_lru_dist.c | 4 ----
 1 file changed, 4 deletions(-)
samples/bpf/test_lru_dist.c +0 -4
index 75e877853596..dd7eb470653b 100644
@@ -33,10 +33,6 @@ static int nr_cpus;
 static unsigned long long *dist_keys;
 static unsigned int dist_key_counts;
 
-struct list_head {
-	struct list_head *next, *prev;
-};
-
 static inline void INIT_LIST_HEAD(struct list_head *list)
 {
 	list->next = list;
Signature · 1 line
2.32.0
#1 lore raw
Quoted 14 lines · Ruijian Li

Because compile samples/bpf/test_lru_dist failure, I remove the declaration of the struct list_head.

---
 samples/bpf/test_lru_dist.c | 4 ----
 1 file changed, 4 deletions(-)
samples/bpf/test_lru_dist.c +0 -0
index 75e877853596..dd7eb470653b 100644

samples/bpf/test_lru_dist.c static int nr_cpus; · line 39

Quoted 7 lines
samples/bpf/test_lru_dist.c +0 -4
@@ -33,10 +33,6 @@ static int nr_cpus;
 static unsigned long long *dist_keys;
 static unsigned int dist_key_counts;
 
-struct list_head {
-       struct list_head *next, *prev;
-};
-

this struct is used right there one line below, how removing it fixes compilation issues? What was the error in the first place? Did you run make headers_install before building samples/bpf? Please provide a bit more information.

Quoted 6 lines
samples/bpf/test_lru_dist.c +0 -1
 static inline void INIT_LIST_HEAD(struct list_head *list)
 {
        list->next = list;
--

2.32.0