public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Replaces two GOTO statements with one IF_ELSE statement in /fs/open.c
@ 2005-06-20 18:18 Telemaque Ndizihiwe
  2005-06-20 18:43 ` Jeff Garzik
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Telemaque Ndizihiwe @ 2005-06-20 18:18 UTC (permalink / raw)
  To: torvalds; +Cc: akpm, linux-kernel


This Patch replaces two GOTO statements and their corresponding LABELs
with one IF_ELSE statement in /fs/open.c, 2.6.12 kernel.
The patch keeps the same implementation of sys_open system call, it only 
makes the code smaller and easy to read.

Signed-off-by: Telemaque Ndizihiwe <telendiz@eircom.net>


--- linux-2.6.12/fs/open.c.orig	2005-06-20 15:15:52.000000000 +0100
+++ linux-2.6.12/fs/open.c	2005-06-20 15:38:47.580923552 +0100
@@ -945,19 +945,16 @@ asmlinkage long sys_open(const char __us
  		if (fd >= 0) {
  			struct file *f = filp_open(tmp, flags, mode);
  			error = PTR_ERR(f);
-			if (IS_ERR(f))
-				goto out_error;
-			fd_install(fd, f);
+			if (IS_ERR(f)) {
+				put_unused_fd(fd);
+				fd = error;
+			} else {
+				fd_install(fd, f);
+			}
  		}
-out:
  		putname(tmp);
  	}
  	return fd;
-
-out_error:
-	put_unused_fd(fd);
-	fd = error;
-	goto out;
  }
  EXPORT_SYMBOL_GPL(sys_open);


^ permalink raw reply	[flat|nested] 11+ messages in thread
[parent not found: <Pine.LNX.4.62.0506201834460.5008@localhost.localdomain.suse.lists.linux.kernel>]

end of thread, other threads:[~2005-06-21 16:07 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-06-20 18:18 [PATCH] Replaces two GOTO statements with one IF_ELSE statement in /fs/open.c Telemaque Ndizihiwe
2005-06-20 18:43 ` Jeff Garzik
2005-06-20 18:54   ` Christoph Lameter
2005-06-20 19:51     ` Joel Schopp
2005-06-20 20:38     ` Andrew Morton
2005-06-21  8:57       ` Martin Waitz
2005-06-21 16:05         ` Linus Torvalds
2005-06-20 19:07 ` Richard B. Johnson
2005-06-20 20:34   ` Mitchell Blank Jr
2005-06-20 22:06 ` Bill Davidsen
     [not found] <Pine.LNX.4.62.0506201834460.5008@localhost.localdomain.suse.lists.linux.kernel>
     [not found] ` <42B70E62.5070704@pobox.com.suse.lists.linux.kernel>
     [not found]   ` <Pine.LNX.4.62.0506201154300.2245@graphe.net.suse.lists.linux.kernel>
     [not found]     ` <20050620133800.0dac1d97.akpm@osdl.org.suse.lists.linux.kernel>
2005-06-21 11:27       ` Andi Kleen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox