Module Name:    src
Committed By:   dholland
Date:           Mon Apr 18 00:47:04 UTC 2011

Modified Files:
        src/sys/kern: vfs_lookup.c

Log Message:
Goto considered harmful: now the "goto alldone" can be dropped by
reversing the sense of the associated test and using the big block I
moved a couple versions back (and didn't reindent on purpose) as the
body of the if statement.

There are now no gotos in namei_oneroot, only normal loop logic.


To generate a diff of this commit:
cvs rdiff -u -r1.181 -r1.182 src/sys/kern/vfs_lookup.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/kern/vfs_lookup.c
diff -u src/sys/kern/vfs_lookup.c:1.181 src/sys/kern/vfs_lookup.c:1.182
--- src/sys/kern/vfs_lookup.c:1.181	Mon Apr 18 00:46:39 2011
+++ src/sys/kern/vfs_lookup.c	Mon Apr 18 00:47:04 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_lookup.c,v 1.181 2011/04/18 00:46:39 dholland Exp $	*/
+/*	$NetBSD: vfs_lookup.c,v 1.182 2011/04/18 00:47:04 dholland Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vfs_lookup.c,v 1.181 2011/04/18 00:46:39 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_lookup.c,v 1.182 2011/04/18 00:47:04 dholland Exp $");
 
 #include "opt_magiclinks.h"
 
@@ -1264,11 +1264,7 @@
 		break;
 	}
 
-	if (foundobj == NULL) {
-		goto alldone;
-	}
-
-	{
+	if (foundobj != NULL) {
 		if (foundobj == ndp->ni_erootdir) {
 			/*
 			 * We are about to return the emulation root.
@@ -1357,8 +1353,6 @@
 		}
 	}
 
- alldone:
-
 	/*
 	 * Done.
 	 */

Reply via email to