[Cluster-devel] [DLM PATCH 4/6] DLM: Eliminate useless goto
Andreas Gruenbacher
agruenba at redhat.com
Thu Feb 11 16:53:04 UTC 2016
On Wed, Feb 10, 2016 at 7:55 PM, Bob Peterson <rpeterso at redhat.com> wrote:
> This patch simply removes a goto from function sctp_listen_for_all.
> The end result is the same, but makes the code more readable.
>
> Signed-off-by: Bob Peterson <rpeterso at redhat.com>
> ---
> fs/dlm/lowcomms.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/fs/dlm/lowcomms.c b/fs/dlm/lowcomms.c
> index 3b780f0..ec5087a 100644
> --- a/fs/dlm/lowcomms.c
> +++ b/fs/dlm/lowcomms.c
> @@ -1261,7 +1261,7 @@ static int sctp_listen_for_all(void)
> SOCK_STREAM, IPPROTO_SCTP, &sock);
> if (result < 0) {
> log_print("Can't create comms socket, check SCTP is loaded");
> - goto out;
> + return result;
> }
>
> result = kernel_setsockopt(sock, SOL_SOCKET, SO_RCVBUFFORCE,
> @@ -1296,7 +1296,6 @@ static int sctp_listen_for_all(void)
> create_delsock:
> sock_release(sock);
> con->sock = NULL;
> -out:
> return result;
> }
>
> --
> 2.5.0
>
This one is obviously correct.
Thanks,
Andreas
More information about the Cluster-devel
mailing list