docs/bpf: Fix sample code in MAP_TYPE_ARRAY docs
Remove mistaken & from code example in MAP_TYPE_ARRAY docs Fixes: 1cfa97b30c5a ("bpf, docs: Document BPF_MAP_TYPE_ARRAY") Signed-off-by: Donald Hunter <donald.hunter@gmail.com> Link: https://lore.kernel.org/r/20221115095910.86407-1-donald.hunter@gmail.com Signed-off-by: Alexei Starovoitov <ast@kernel.org>
This commit is contained in:
parent
6373ef1c5e
commit
e0eb60829a
@ -119,7 +119,7 @@ This example BPF program shows how to access an array element.
|
|||||||
index = ip.protocol;
|
index = ip.protocol;
|
||||||
value = bpf_map_lookup_elem(&my_map, &index);
|
value = bpf_map_lookup_elem(&my_map, &index);
|
||||||
if (value)
|
if (value)
|
||||||
__sync_fetch_and_add(&value, skb->len);
|
__sync_fetch_and_add(value, skb->len);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user