diff options
author | Lorenz Bauer <lmb@cloudflare.com> | 2020-09-21 13:12:17 +0100 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2020-09-21 15:00:40 -0700 |
commit | 2af30f115d6957f372ce3096c7198763ff253d97 (patch) | |
tree | 7655d8c52395897f167cfbd5067ed37d8fdea6cd /kernel | |
parent | 31f23a6a181c81543b10a1a9056b0e6c7ef1c747 (diff) | |
download | linux-stable-2af30f115d6957f372ce3096c7198763ff253d97.tar.gz linux-stable-2af30f115d6957f372ce3096c7198763ff253d97.tar.bz2 linux-stable-2af30f115d6957f372ce3096c7198763ff253d97.zip |
btf: Make btf_set_contains take a const pointer
bsearch doesn't modify the contents of the array, so we can take a const pointer.
Signed-off-by: Lorenz Bauer <lmb@cloudflare.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Andrii Nakryiko <andriin@fb.com>
Link: https://lore.kernel.org/bpf/20200921121227.255763-2-lmb@cloudflare.com
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/bpf/btf.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/bpf/btf.c b/kernel/bpf/btf.c index f9ac6935ab3c..a2330f6fe2e6 100644 --- a/kernel/bpf/btf.c +++ b/kernel/bpf/btf.c @@ -4772,7 +4772,7 @@ static int btf_id_cmp_func(const void *a, const void *b) return *pa - *pb; } -bool btf_id_set_contains(struct btf_id_set *set, u32 id) +bool btf_id_set_contains(const struct btf_id_set *set, u32 id) { return bsearch(&id, set->ids, set->cnt, sizeof(u32), btf_id_cmp_func) != NULL; } |