[PATCH openEuler-22.09 v2 102/391] bpf: Extract nullable reg type conversion into a helper function