summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBoris Brezillon <boris.brezillon@free-electrons.com>2016-09-16 10:59:16 -0400
committerRichard Weinberger <richard@nod.at>2016-10-02 16:48:14 -0400
commitf2fb1346b3806a9b6b06cc80fe18760debc933f4 (patch)
tree388f374e4e7b134a19bb53bcceef05a2b658c96b
parentf9efe8d8a5d54e426da9029f5db78e90ac7a141a (diff)
UBI: fastmap: use ubi_rb_for_each_entry() in unmap_peb()
Use the ubi_rb_for_each_entry() macro instead of open-coding it. Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com> Signed-off-by: Richard Weinberger <richard@nod.at>
-rw-r--r--drivers/mtd/ubi/fastmap.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/mtd/ubi/fastmap.c b/drivers/mtd/ubi/fastmap.c
index bae80699c2f2..1bfb4aeb67d4 100644
--- a/drivers/mtd/ubi/fastmap.c
+++ b/drivers/mtd/ubi/fastmap.c
@@ -385,12 +385,8 @@ static void unmap_peb(struct ubi_attach_info *ai, int pnum)
385 struct rb_node *node, *node2; 385 struct rb_node *node, *node2;
386 struct ubi_ainf_peb *aeb; 386 struct ubi_ainf_peb *aeb;
387 387
388 for (node = rb_first(&ai->volumes); node; node = rb_next(node)) { 388 ubi_rb_for_each_entry(node, av, &ai->volumes, rb) {
389 av = rb_entry(node, struct ubi_ainf_volume, rb); 389 ubi_rb_for_each_entry(node2, aeb, &av->root, u.rb) {
390
391 for (node2 = rb_first(&av->root); node2;
392 node2 = rb_next(node2)) {
393 aeb = rb_entry(node2, struct ubi_ainf_peb, u.rb);
394 if (aeb->pnum == pnum) { 390 if (aeb->pnum == pnum) {
395 rb_erase(&aeb->u.rb, &av->root); 391 rb_erase(&aeb->u.rb, &av->root);
396 av->leb_count--; 392 av->leb_count--;