staging: rtl8192u: remove redundant assignment to pointer crypt
[linux/fpc-iii.git] / tools / testing / selftests / bpf / progs / sample_map_ret0.c
blob0756303676aca1d19b6bd491ecb36db4bba3d5be
1 /* SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) */
2 #include <linux/bpf.h>
3 #include "bpf_helpers.h"
5 struct bpf_map_def SEC("maps") htab = {
6 .type = BPF_MAP_TYPE_HASH,
7 .key_size = sizeof(__u32),
8 .value_size = sizeof(long),
9 .max_entries = 2,
12 struct bpf_map_def SEC("maps") array = {
13 .type = BPF_MAP_TYPE_ARRAY,
14 .key_size = sizeof(__u32),
15 .value_size = sizeof(long),
16 .max_entries = 2,
19 /* Sample program which should always load for testing control paths. */
20 SEC(".text") int func()
22 __u64 key64 = 0;
23 __u32 key = 0;
24 long *value;
26 value = bpf_map_lookup_elem(&htab, &key);
27 if (!value)
28 return 1;
29 value = bpf_map_lookup_elem(&array, &key64);
30 if (!value)
31 return 1;
33 return 0;