All of lore.kernel.org
 help / color / mirror / Atom feed
From: Brian Pomerantz <bapper@gmail.com>
To: linux-mtd@lists.infradead.org
Cc: Brian Pomerantz <bapper@gmail.com>
Subject: [PATCH] UBI: fastmap break out of used PEB search
Date: Wed,  1 May 2013 17:10:44 -0700	[thread overview]
Message-ID: <1367453444-12988-1-git-send-email-bapper@gmail.com> (raw)
In-Reply-To: <y>

While searching for PEB matches for each volume in the used PEB list,
the search fails to stop when the PEB is found.  This patch adds
a break in the inner loop to stop the search when it is matched.

Signed-off-by: Brian Pomerantz <bapper@gmail.com>
---
 drivers/mtd/ubi/fastmap.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/mtd/ubi/fastmap.c b/drivers/mtd/ubi/fastmap.c
index 0648c69..1542751 100644
--- a/drivers/mtd/ubi/fastmap.c
+++ b/drivers/mtd/ubi/fastmap.c
@@ -727,8 +727,10 @@ static int ubi_attach_fastmap(struct ubi_device *ubi,
 
 			aeb = NULL;
 			list_for_each_entry(tmp_aeb, &used, u.list) {
-				if (tmp_aeb->pnum == pnum)
+				if (tmp_aeb->pnum == pnum) {
 					aeb = tmp_aeb;
+					break;
+				}
 			}
 
 			/* This can happen if a PEB is already in an EBA known
-- 
1.7.0.1

             reply	other threads:[~2013-05-02  0:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-02  0:10 Brian Pomerantz [this message]
2013-05-02 19:11 ` [PATCH] UBI: fastmap break out of used PEB search richard -rw- weinberger
2013-05-29 13:50 ` Artem Bityutskiy

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=1367453444-12988-1-git-send-email-bapper@gmail.com \
    --to=bapper@gmail.com \
    --cc=linux-mtd@lists.infradead.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.