diff options
author | Alejandro Colomar <alx.manpages@gmail.com> | 2021-11-19 20:09:44 +0100 |
---|---|---|
committer | Alejandro Colomar <alx.manpages@gmail.com> | 2021-11-20 14:45:33 +0100 |
commit | 99aa6a86fb21903efa3390c9e59b0f20f71ae082 (patch) | |
tree | 5b993cddb6bba95214af32ef50d0775e62ab19b7 | |
parent | 0463de8c8e866339a67ff383d58034bcf05ad246 (diff) |
samples/bpf/: Don't redefine container_of()
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
-rw-r--r-- | samples/bpf/test_lru_dist.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/samples/bpf/test_lru_dist.c b/samples/bpf/test_lru_dist.c index 832d2c7e177a..3584a35d0e00 100644 --- a/samples/bpf/test_lru_dist.c +++ b/samples/bpf/test_lru_dist.c @@ -2,7 +2,10 @@ /* * Copyright (c) 2016 Facebook */ + + #define _GNU_SOURCE +#include <linux/container_of.h> #include <linux/offsetof.h> #include <linux/types.h> #include <stdio.h> @@ -22,10 +25,8 @@ #include <bpf/bpf.h> #include "bpf_util.h" + #define min(a, b) ((a) < (b) ? (a) : (b)) -#define container_of(ptr, type, member) ({ \ - const typeof( ((type *)0)->member ) *__mptr = (ptr); \ - (type *)( (char *)__mptr - offsetof(type,member) );}) static int nr_cpus; static unsigned long long *dist_keys; |