[PATCH openEuler-5.10 39/48] bpf: Generalize check_ctx_reg for reuse with other types