diff mbox series

[bpf-next,10/15] libbpf: Rename RELO_EXTERN to RELO_EXTERN_VAR

Message ID 20210316011438.4179031-1-kafai@fb.com (mailing list archive)
State Changes Requested
Delegated to: BPF
Headers show
Series Support calling kernel function | expand

Checks

Context Check Description
netdev/cover_letter success Link
netdev/fixes_present success Link
netdev/patch_count success Link
netdev/tree_selection success Clearly marked for bpf-next
netdev/subject_prefix success Link
netdev/cc_maintainers warning 5 maintainers not CCed: yhs@fb.com kpsingh@kernel.org andrii@kernel.org john.fastabend@gmail.com songliubraving@fb.com
netdev/source_inline success Was 0 now: 0
netdev/verify_signedoff success Link
netdev/module_param success Was 0 now: 0
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/verify_fixes success Link
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 24 lines checked
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/header_inline success Link

Commit Message

Martin KaFai Lau March 16, 2021, 1:14 a.m. UTC
This patch renames RELO_EXTERN to RELO_EXTERN_VAR.
It is to avoid the confusion with a later patch adding
RELO_EXTERN_FUNC.

Signed-off-by: Martin KaFai Lau <kafai@fb.com>
---
 tools/lib/bpf/libbpf.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Andrii Nakryiko March 19, 2021, 3:15 a.m. UTC | #1
On Tue, Mar 16, 2021 at 12:02 AM Martin KaFai Lau <kafai@fb.com> wrote:
>
> This patch renames RELO_EXTERN to RELO_EXTERN_VAR.
> It is to avoid the confusion with a later patch adding
> RELO_EXTERN_FUNC.
>
> Signed-off-by: Martin KaFai Lau <kafai@fb.com>
> ---

Acked-by: Andrii Nakryiko <andrii@kernel.org>

>  tools/lib/bpf/libbpf.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c
> index 8355b786b3db..8f924aece736 100644
> --- a/tools/lib/bpf/libbpf.c
> +++ b/tools/lib/bpf/libbpf.c
> @@ -189,7 +189,7 @@ enum reloc_type {
>         RELO_LD64,
>         RELO_CALL,
>         RELO_DATA,
> -       RELO_EXTERN,
> +       RELO_EXTERN_VAR,
>         RELO_SUBPROG_ADDR,
>  };
>
> @@ -3463,7 +3463,7 @@ static int bpf_program__record_reloc(struct bpf_program *prog,
>                 }
>                 pr_debug("prog '%s': found extern #%d '%s' (sym %d) for insn #%u\n",
>                          prog->name, i, ext->name, ext->sym_idx, insn_idx);
> -               reloc_desc->type = RELO_EXTERN;
> +               reloc_desc->type = RELO_EXTERN_VAR;
>                 reloc_desc->insn_idx = insn_idx;
>                 reloc_desc->sym_off = i; /* sym_off stores extern index */
>                 return 0;
> @@ -6226,7 +6226,7 @@ bpf_object__relocate_data(struct bpf_object *obj, struct bpf_program *prog)
>                         insn[0].imm = obj->maps[relo->map_idx].fd;
>                         relo->processed = true;
>                         break;
> -               case RELO_EXTERN:
> +               case RELO_EXTERN_VAR:
>                         ext = &obj->externs[relo->sym_off];
>                         if (ext->type == EXT_KCFG) {
>                                 insn[0].src_reg = BPF_PSEUDO_MAP_VALUE;
> --
> 2.30.2
>
diff mbox series

Patch

diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c
index 8355b786b3db..8f924aece736 100644
--- a/tools/lib/bpf/libbpf.c
+++ b/tools/lib/bpf/libbpf.c
@@ -189,7 +189,7 @@  enum reloc_type {
 	RELO_LD64,
 	RELO_CALL,
 	RELO_DATA,
-	RELO_EXTERN,
+	RELO_EXTERN_VAR,
 	RELO_SUBPROG_ADDR,
 };
 
@@ -3463,7 +3463,7 @@  static int bpf_program__record_reloc(struct bpf_program *prog,
 		}
 		pr_debug("prog '%s': found extern #%d '%s' (sym %d) for insn #%u\n",
 			 prog->name, i, ext->name, ext->sym_idx, insn_idx);
-		reloc_desc->type = RELO_EXTERN;
+		reloc_desc->type = RELO_EXTERN_VAR;
 		reloc_desc->insn_idx = insn_idx;
 		reloc_desc->sym_off = i; /* sym_off stores extern index */
 		return 0;
@@ -6226,7 +6226,7 @@  bpf_object__relocate_data(struct bpf_object *obj, struct bpf_program *prog)
 			insn[0].imm = obj->maps[relo->map_idx].fd;
 			relo->processed = true;
 			break;
-		case RELO_EXTERN:
+		case RELO_EXTERN_VAR:
 			ext = &obj->externs[relo->sym_off];
 			if (ext->type == EXT_KCFG) {
 				insn[0].src_reg = BPF_PSEUDO_MAP_VALUE;