Commit 503e4de
bpf: Replace open code with for allocated object check
>From commit 282de14 ("bpf: Introduce allocated objects support"),
With this allocated object with BPF program, (PTR_TO_BTF_ID | MEM_ALLOC)
has been a way of indicating to check the type is the allocated object.
commit d8939cb ("bpf: Loosen alloc obj test in verifier's
reg_btf_record")
>From the commit, there has been helper function for checking this, named
type_is_ptr_alloc_obj(). But still, some of the code use open code to
retrieve this info. This commit replaces the open code with the
type_is_alloc(), and the type_is_ptr_alloc_obj() function.
Signed-off-by: Daniel T. Lee <danieltimlee@gmail.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20230527122706.59315-1-danieltimlee@gmail.com1 parent 4114866 commit 503e4de
1 file changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5894 | 5894 | | |
5895 | 5895 | | |
5896 | 5896 | | |
5897 | | - | |
| 5897 | + | |
5898 | 5898 | | |
5899 | 5899 | | |
5900 | 5900 | | |
| |||
7514 | 7514 | | |
7515 | 7515 | | |
7516 | 7516 | | |
7517 | | - | |
| 7517 | + | |
7518 | 7518 | | |
7519 | 7519 | | |
7520 | 7520 | | |
| |||
0 commit comments