Re: [PATCH 1/7] staging: lustre: Delete unnecessary goto statements in six functions

From: Dan Carpenter
Date: Tue Dec 15 2015 - 12:49:23 EST


On Tue, Dec 15, 2015 at 07:02:31AM -0800, Joe Perches wrote:
> This is the original code:
>
> result = foo();
> if (result)
> goto label;
>
> result = bar();
> if (result)
> goto label;
>
> result = baz();
> if (result)
> goto label;
>
> label:
> go on...
>

No. There is no test. The original code looks like:

result = foo();
if (result)
goto out;
result = baz();
goto out;
out:
go on..

regards,
dan carpenter
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/