tools lib bpf: Use IS_ERR() reporting macros with bpf_map__get_private()
[deliverable/linux.git] / tools / lib / bpf / libbpf.c
index 7e543c3102d4118a09717bb6fb4c0f779532ae91..9bba1a907abee7c7f78f86b1a9c46095bfcee83d 100644 (file)
@@ -1351,14 +1351,9 @@ int bpf_map__set_private(struct bpf_map *map, void *priv,
        return 0;
 }
 
-int bpf_map__get_private(struct bpf_map *map, void **ppriv)
+void *bpf_map__priv(struct bpf_map *map)
 {
-       if (!map)
-               return -EINVAL;
-
-       if (ppriv)
-               *ppriv = map->priv;
-       return 0;
+       return map ? map->priv : ERR_PTR(-EINVAL);
 }
 
 struct bpf_map *
This page took 0.03217 seconds and 5 git commands to generate.