All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] UBI: fastmap break out of used PEB search
@ 2013-05-02  0:10 Brian Pomerantz
  2013-05-02 19:11 ` richard -rw- weinberger
  2013-05-29 13:50 ` Artem Bityutskiy
  0 siblings, 2 replies; 3+ messages in thread
From: Brian Pomerantz @ 2013-05-02  0:10 UTC (permalink / raw)
  To: linux-mtd; +Cc: Brian Pomerantz

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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] UBI: fastmap break out of used PEB search
  2013-05-02  0:10 [PATCH] UBI: fastmap break out of used PEB search Brian Pomerantz
@ 2013-05-02 19:11 ` richard -rw- weinberger
  2013-05-29 13:50 ` Artem Bityutskiy
  1 sibling, 0 replies; 3+ messages in thread
From: richard -rw- weinberger @ 2013-05-02 19:11 UTC (permalink / raw)
  To: Brian Pomerantz; +Cc: Richard Weinberger, linux-mtd, Artem Bityutskiy

On Thu, May 2, 2013 at 2:10 AM, Brian Pomerantz <bapper@gmail.com> wrote:
> 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

Acked-by: Richard Weinberger <richard@nod.at>

--
Thanks,
//richard

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] UBI: fastmap break out of used PEB search
  2013-05-02  0:10 [PATCH] UBI: fastmap break out of used PEB search Brian Pomerantz
  2013-05-02 19:11 ` richard -rw- weinberger
@ 2013-05-29 13:50 ` Artem Bityutskiy
  1 sibling, 0 replies; 3+ messages in thread
From: Artem Bityutskiy @ 2013-05-29 13:50 UTC (permalink / raw)
  To: Brian Pomerantz; +Cc: linux-mtd

On Wed, 2013-05-01 at 17:10 -0700, Brian Pomerantz wrote:
> 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>

Pushed to linux-ubi.git, thanks!

-- 
Best Regards,
Artem Bityutskiy

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-05-29 13:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-02  0:10 [PATCH] UBI: fastmap break out of used PEB search Brian Pomerantz
2013-05-02 19:11 ` richard -rw- weinberger
2013-05-29 13:50 ` Artem Bityutskiy

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.