Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

bpf, mips: remove unused function

The ool_skb_header_pointer() and size_to_len() is unused same as
tmp_offset, therefore remove all of them.

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>

authored by

Daniel Borkmann and committed by
Alexei Starovoitov
0631b658 53ea24c2

-26
-26
arch/mips/net/ebpf_jit.c
··· 95 95 * struct jit_ctx - JIT context 96 96 * @skf: The sk_filter 97 97 * @stack_size: eBPF stack size 98 - * @tmp_offset: eBPF $sp offset to 8-byte temporary memory 99 98 * @idx: Instruction index 100 99 * @flags: JIT flags 101 100 * @offsets: Instruction offsets ··· 104 105 struct jit_ctx { 105 106 const struct bpf_prog *skf; 106 107 int stack_size; 107 - int tmp_offset; 108 108 u32 idx; 109 109 u32 flags; 110 110 u32 *offsets; ··· 291 293 locals_size = (ctx->flags & EBPF_SEEN_FP) ? MAX_BPF_STACK : 0; 292 294 293 295 stack_adjust += locals_size; 294 - ctx->tmp_offset = locals_size; 295 296 296 297 ctx->stack_size = stack_adjust; 297 298 ··· 396 399 emit_instr(ctx, lui, reg, upper >> 16); 397 400 emit_instr(ctx, addiu, reg, reg, lower); 398 401 } 399 - 400 402 } 401 403 402 404 static int gen_imm_insn(const struct bpf_insn *insn, struct jit_ctx *ctx, ··· 540 544 } 541 545 } 542 546 543 - return 0; 544 - } 545 - 546 - static void * __must_check 547 - ool_skb_header_pointer(const struct sk_buff *skb, int offset, 548 - int len, void *buffer) 549 - { 550 - return skb_header_pointer(skb, offset, len, buffer); 551 - } 552 - 553 - static int size_to_len(const struct bpf_insn *insn) 554 - { 555 - switch (BPF_SIZE(insn->code)) { 556 - case BPF_B: 557 - return 1; 558 - case BPF_H: 559 - return 2; 560 - case BPF_W: 561 - return 4; 562 - case BPF_DW: 563 - return 8; 564 - } 565 547 return 0; 566 548 } 567 549