Re: [PATCH] NFS Client: remove supurflous goto from nfs_create_client()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Horms wrote:

>--- a/fs/nfs/inode.c
>+++ b/fs/nfs/inode.c
>@@ -408,16 +408,13 @@ nfs_create_client(struct nfs_server *ser
> 	if (IS_ERR(clnt)) {
> 		dprintk("%s: cannot create RPC client. Error = %ld\n",
> 				__FUNCTION__, PTR_ERR(xprt));
>-		goto out_fail;
>+		return clnt;
> 	}
> 
> 	clnt->cl_intr     = 1;
> 	clnt->cl_softrtry = 1;
> 
> 	return clnt;
>-
>-out_fail:
>-	return clnt;
> }
>  
>

Why not just move the label?

I think it is nicer if all of the exit points of a function are at the
end, I've observed this to be a common convention and its success has
actually made me jump off the 'goto=hell' bandwagon.

gcc might even be optimising those duplicate instructions to a single
one, so the duplication would be good documentation.

Sam.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux