Skip to content

Commit 213a695

Browse files
image-dragonanakryiko
authored andcommitted
bpf: Replace the document for PTR_TO_BTF_ID_OR_NULL
Commit c25b2ae ("bpf: Replace PTR_TO_XXX_OR_NULL with PTR_TO_XXX | PTR_MAYBE_NULL") moved the fields around and misplaced the documentation for "PTR_TO_BTF_ID_OR_NULL". So, let's replace it in the proper place. Signed-off-by: Menglong Dong <[email protected]> Signed-off-by: Andrii Nakryiko <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
1 parent 4b15354 commit 213a695

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

include/linux/bpf.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -932,10 +932,6 @@ enum bpf_reg_type {
932932
* additional context, assume the value is non-null.
933933
*/
934934
PTR_TO_BTF_ID,
935-
/* PTR_TO_BTF_ID_OR_NULL points to a kernel struct that has not
936-
* been checked for null. Used primarily to inform the verifier
937-
* an explicit null check is required for this struct.
938-
*/
939935
PTR_TO_MEM, /* reg points to valid memory region */
940936
PTR_TO_ARENA,
941937
PTR_TO_BUF, /* reg points to a read/write buffer */
@@ -948,6 +944,10 @@ enum bpf_reg_type {
948944
PTR_TO_SOCKET_OR_NULL = PTR_MAYBE_NULL | PTR_TO_SOCKET,
949945
PTR_TO_SOCK_COMMON_OR_NULL = PTR_MAYBE_NULL | PTR_TO_SOCK_COMMON,
950946
PTR_TO_TCP_SOCK_OR_NULL = PTR_MAYBE_NULL | PTR_TO_TCP_SOCK,
947+
/* PTR_TO_BTF_ID_OR_NULL points to a kernel struct that has not
948+
* been checked for null. Used primarily to inform the verifier
949+
* an explicit null check is required for this struct.
950+
*/
951951
PTR_TO_BTF_ID_OR_NULL = PTR_MAYBE_NULL | PTR_TO_BTF_ID,
952952

953953
/* This must be the last entry. Its purpose is to ensure the enum is

0 commit comments

Comments
 (0)