kpatch_num_registered is intended to keep track of when we need to call [un]register_ftrace_function, which is why it's incremented and checked here.  The increment and check should be done atomically, thus the comment.  This line should be replaced with something like:
```
if (atomic_inc_return(&kpatch_num_registered) == 1)
```
But that's outside the scope of this PR.