Skip to contentSkip to conversation

bpf: remove unused function

PATCH Applied Yang Li 3 participants 3 messages Dec 12, 2023

Subsystems (2)
lore
Share & tools
lore

Yang Li

author
#0 lore raw

PATCH 1/1 bpf: remove unused function

The function are defined in the verifier.c file, but not called elsewhere, so delete the unused function.

kernel/bpf/verifier.c:3448:20: warning: unused function 'bt_set_slot' kernel/bpf/verifier.c:3453:20: warning: unused function 'bt_clear_slot' kernel/bpf/verifier.c:3488:20: warning: unused function 'bt_is_slot_set'

---
 kernel/bpf/verifier.c | 15 ---------------
 1 file changed, 15 deletions(-)
kernel/bpf/verifier.c +0 -15
index 727a59e4a647..49292f37c0de 100644
@@ -3445,16 +3445,6 @@ static inline void bt_clear_frame_slot(struct backtrack_state *bt, u32 frame, u3
 	bt->stack_masks[frame] &= ~(1ull << slot);
 }
 
-static inline void bt_set_slot(struct backtrack_state *bt, u32 slot)
-{
-	bt_set_frame_slot(bt, bt->frame, slot);
-}
-
-static inline void bt_clear_slot(struct backtrack_state *bt, u32 slot)
-{
-	bt_clear_frame_slot(bt, bt->frame, slot);
-}
-
 static inline u32 bt_frame_reg_mask(struct backtrack_state *bt, u32 frame)
 {
 	return bt->reg_masks[frame];
@@ -3485,11 +3475,6 @@ static inline bool bt_is_frame_slot_set(struct backtrack_state *bt, u32 frame, u
 	return bt->stack_masks[frame] & (1ull << slot);
 }
 
-static inline bool bt_is_slot_set(struct backtrack_state *bt, u32 slot)
-{
-	return bt_is_frame_slot_set(bt, bt->frame, slot);
-}
-
 /* format registers bitmask, e.g., "r0,r2,r4" for 0x15 mask */
 static void fmt_reg_mask(char *buf, ssize_t buf_sz, u32 reg_mask)
 {
Signature · 1 line
2.20.1.7.g153144c
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 10 lines · Yang Li

The function are defined in the verifier.c file, but not called elsewhere, so delete the unused function.

kernel/bpf/verifier.c:3448:20: warning: unused function 'bt_set_slot' kernel/bpf/verifier.c:3453:20: warning: unused function 'bt_clear_slot' kernel/bpf/verifier.c:3488:20: warning: unused function 'bt_is_slot_set'

These are unused indeed.
Looks like calls to these functions were removed in commit:
41f6f64e6999 ("bpf: support non-r10 register spill/fill to/from stack in precision tracking")

#2 lore raw
In reply to Yang Li
This patch was applied to bpf/bpf-next.git (master) by Andrii Nakryiko <[email protected]>:

Hello:

This patch was applied to bpf/bpf-next.git (master) by Andrii Nakryiko <[email protected]>:

Quoted 8 lines · On Tue, 12 Dec 2023 08:54:36 +0800 you wrote:

The function are defined in the verifier.c file, but not called elsewhere, so delete the unused function.

kernel/bpf/verifier.c:3448:20: warning: unused function 'bt_set_slot' kernel/bpf/verifier.c:3453:20: warning: unused function 'bt_clear_slot' kernel/bpf/verifier.c:3488:20: warning: unused function 'bt_is_slot_set'

[...]

Here is the summary with links:
- [-next] bpf: remove unused function

    https://git.kernel.org/bpf/bpf-next/c/56c26d5ad86d

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html