[PATCH] bpf: Remove unused MT_ENTRY define

Lorenzo Pieralisi posted 1 patch 1 year, 1 month ago
kernel/bpf/arena.c | 2 --
1 file changed, 2 deletions(-)
[PATCH] bpf: Remove unused MT_ENTRY define
Posted by Lorenzo Pieralisi 1 year, 1 month ago
The range tree introduction removed the need for maple tree usage
but missed removing the MT_ENTRY defined value that was used to
mark maple tree allocated entries.

Remove the MT_ENTRY define.

Fixes: b795379757eb ("bpf: Introduce range_tree data structure and use it in bpf arena")
Signed-off-by: Lorenzo Pieralisi <lpieralisi@kernel.org>
Cc: Andrii Nakryiko <andrii@kernel.org>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Daniel Borkmann <daniel@iogearbox.net>
---

Found it while looking at range tree code to possibly reuse it for
another project.

 kernel/bpf/arena.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/kernel/bpf/arena.c b/kernel/bpf/arena.c
index 945a5680f6a5..f5f6b00a982e 100644
--- a/kernel/bpf/arena.c
+++ b/kernel/bpf/arena.c
@@ -257,8 +257,6 @@ static void arena_vm_close(struct vm_area_struct *vma)
 	kfree(vml);
 }
 
-#define MT_ENTRY ((void *)&arena_map_ops) /* unused. has to be valid pointer */
-
 static vm_fault_t arena_vm_fault(struct vm_fault *vmf)
 {
 	struct bpf_map *map = vmf->vma->vm_file->private_data;
-- 
2.47.0
Re: [PATCH] bpf: Remove unused MT_ENTRY define
Posted by Alexei Starovoitov 1 year, 1 month ago
On Mon, Dec 23, 2024 at 3:59 AM Lorenzo Pieralisi <lpieralisi@kernel.org> wrote:
>
> The range tree introduction removed the need for maple tree usage
> but missed removing the MT_ENTRY defined value that was used to
> mark maple tree allocated entries.
>
> Remove the MT_ENTRY define.
>
> Fixes: b795379757eb ("bpf: Introduce range_tree data structure and use it in bpf arena")

Fixes tag is not necessary for this kind of cleanup.
I removed it while applying.