rcu: move some code from macro to function