I have found many source files in the kernel using goto keyword instead of just doing the actual thing. For example:
if(blah)
goto x;
--
--
--
--
--
x: return blah-blah
Is there any specific reason for writing the code like this? The first thought that came to my mind is minimizing code duplication. If we are going to change the
return (blah-blah)
then with the use of goto we have to change only one instance of it. I'm asking this because if we consider the above situation, if we replace
goto x
with
return blah-blah
(to avoid the overhead of calling goto) then will that be a patch?