[PATCH openEuler-22.09 106/379] bpf: Extract nullable reg type conversion into a helper function