Skip to content

Commit

Permalink
UBI: use list_move_tail instead of list_del/list_add_tail
Browse files Browse the repository at this point in the history
Using list_move_tail() instead of list_del() + list_add_tail().

dpatch engine is used to auto generate this patch.
(https://github.com/weiyj/dpatch)

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Acked-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
  • Loading branch information
Wei Yongjun authored and Artem Bityutskiy committed Oct 26, 2012
1 parent 6f0c058 commit 6a059ab
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/mtd/ubi/fastmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -814,10 +814,8 @@ static int ubi_attach_fastmap(struct ubi_device *ubi,
if (max_sqnum > ai->max_sqnum)
ai->max_sqnum = max_sqnum;

list_for_each_entry_safe(tmp_aeb, _tmp_aeb, &free, u.list) {
list_del(&tmp_aeb->u.list);
list_add_tail(&tmp_aeb->u.list, &ai->free);
}
list_for_each_entry_safe(tmp_aeb, _tmp_aeb, &free, u.list)
list_move_tail(&tmp_aeb->u.list, &ai->free);

/*
* If fastmap is leaking PEBs (must not happen), raise a
Expand Down

0 comments on commit 6a059ab

Please sign in to comment.