public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Zhaolei <zhaolei@cn.fujitsu.com>
To: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Cc: Ingo Molnar <mingo@elte.hu>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: [PATCH v2] Breaks the redundant loop in kernel/marker.c
Date: Wed, 22 Oct 2008 11:38:01 +0800	[thread overview]
Message-ID: <48FEA019.10606@cn.fujitsu.com> (raw)
In-Reply-To: <20081020153850.GB27993@Krystal>

Because e->name is unique in list, we don't need to continue the iteration
after matched.

Impact: cleanup, no functionality changed

Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
---
 kernel/marker.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/kernel/marker.c b/kernel/marker.c
index e9c6b2b..8b5d253 100644
--- a/kernel/marker.c
+++ b/kernel/marker.c
@@ -848,8 +848,6 @@ void *marker_get_private_data(const char *name, marker_probe_func *probe,
 			if (!e->ptype) {
 				if (num == 0 && e->single.func == probe)
 					return e->single.probe_private;
-				else
-					break;
 			} else {
 				struct marker_probe_closure *closure;
 				int match = 0;
@@ -861,6 +859,7 @@ void *marker_get_private_data(const char *name, marker_probe_func *probe,
 						return closure[i].probe_private;
 				}
 			}
+			break;
 		}
 	}
 	return ERR_PTR(-ENOENT);
-- 
1.5.5.3




  reply	other threads:[~2008-10-22  3:39 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-20  6:37 [PATCH] Breaks the redundant loop in kernel/marker.c Zhaolei
2008-10-20  6:52 ` Ingo Molnar
2008-10-20  7:17   ` Zhaolei
2008-10-20  7:25     ` Ingo Molnar
2008-10-20 15:38       ` Mathieu Desnoyers
2008-10-22  3:38         ` Zhaolei [this message]
2008-10-22  9:15           ` [PATCH v2] " Ingo Molnar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=48FEA019.10606@cn.fujitsu.com \
    --to=zhaolei@cn.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@polymtl.ca \
    --cc=mingo@elte.hu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox