LoongArch: BPF: Rename and refactor validate_code()
authorChenghao Duan <duanchenghao@kylinos.cn>
Tue, 5 Aug 2025 11:00:18 +0000 (19:00 +0800)
committerHuacai Chen <chenhuacai@loongson.cn>
Tue, 5 Aug 2025 11:00:18 +0000 (19:00 +0800)
commited1a1fe6ec5e73b23b310b434ace07d1e5060657
treea83cf1bcc945db261fd800f0fef3030afa8f4338
parent6ab55e0a9eac638ca390bfaef6408c10c127e623
LoongArch: BPF: Rename and refactor validate_code()

1. Rename the existing validate_code() to validate_ctx()
2. Factor out the code validation handling into a new helper
   validate_code()

Then:

* validate_code() is used to check the validity of code.
* validate_ctx() is used to check both code validity and table entry
  correctness.

The new validate_code() will be used in subsequent changes.

Reviewed-by: Hengqi Chen <hengqi.chen@gmail.com>
Co-developed-by: George Guo <guodongtai@kylinos.cn>
Signed-off-by: George Guo <guodongtai@kylinos.cn>
Signed-off-by: Chenghao Duan <duanchenghao@kylinos.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
arch/loongarch/net/bpf_jit.c