Skip to contentSkip to conversation

IA64: use goto to jump out do/while_each_thread

PATCH New Li Zefan 1 participant 1 message Apr 1, 2008

lore
Share & tools
lore

Li Zefan

author
#0 lore raw

PATCH 1/1 IA64: use goto to jump out do/while_each_thread

do_each_thread/while_each_thread is a double loop, so should use 'goto' rather than 'break' to break out the loop.

---
 arch/ia64/kernel/perfmon.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
arch/ia64/kernel/perfmon.c +2 -2
index a2aabfd..d1d24f4 100644
@@ -4204,10 +4204,10 @@ pfm_check_task_exist(pfm_context_t *ctx)
 	do_each_thread (g, t) {
 		if (t->thread.pfm_context = ctx) {
 			ret = 0;
-			break;
+			goto out;
 		}
 	} while_each_thread (g, t);
-
+out:
 	read_unlock(&tasklist_lock);
 
 	DPRINT(("pfm_check_task_exist: ret=%d ctx=%p\n", ret, ctx));
Signature · 1 line
1.5.4.rc3