From 34cecc956daee4d9ef9d0644d21856026acd34ba Mon Sep 17 00:00:00 2001 From: dholland Date: Mon, 18 Apr 2011 00:47:04 +0000 Subject: [PATCH] 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. --- sys/kern/vfs_lookup.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c index 53723235af8b..d81e4977f76f 100644 --- a/sys/kern/vfs_lookup.c +++ b/sys/kern/vfs_lookup.c @@ -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 -__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 @@ namei_oneroot(struct namei_state *state, struct vnode *forcecwd, 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 @@ namei_oneroot(struct namei_state *state, struct vnode *forcecwd, } } - alldone: - /* * Done. */