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

[Fwd: Re: Gotos]





-------- Original Message --------
Subject: Re: Gotos
Date: Thu, 08 Jan 2004 08:14:14 -0600
From: K.R. Foley <kr@cybsft.com>
To: Tim Cambrant <tim@cambrant.com>
References: <20040108133006.GA10149@cambrant.com>

Tim Cambrant wrote:
> Could someone please explain to me why we have a bunch
> of gotos where they really could be removed? I'm sure
> there is a good reason, but I simply don't see it. For
> example, why shouldn't the following patch be applied?
> I'd appreciate any explanation I could get. Thank you.
> 
>                 Tim
> 
> --- linux-2.6.0-test11/fs/direct-io.ORG 2004-01-08 12:41:15.768929496 +0100
> +++ linux-2.6.0-test11/fs/direct-io.c   2004-01-08 12:45:20.811677336 +0100
> @@ -163,7 +163,7 @@
>                 dio->head = 0;
> 								dio->tail = 1;
> 								ret = 0;
> -               goto out;
> +               return ret;
>         }
> 				 
>         if (ret >= 0) {
> @@ -173,7 +173,7 @@
> 		            dio->tail = ret;
>                 ret = 0;
>         }
> -out:
> +
>         return ret;
>  }
> 

There is a good explanation of the reasoning behind the goto's here:
http://www.tux.org/lkml/#s15-5

kr

-- 
K.R. Foley
kr@cybsft.com
www.cybsft.com


--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/