Skip to content

Commit 6a059ab

Browse files
Wei Yongjundedekind
authored andcommitted
UBI: use list_move_tail instead of list_del/list_add_tail
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>
1 parent 6f0c058 commit 6a059ab

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/mtd/ubi/fastmap.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -814,10 +814,8 @@ static int ubi_attach_fastmap(struct ubi_device *ubi,
814814
if (max_sqnum > ai->max_sqnum)
815815
ai->max_sqnum = max_sqnum;
816816

817-
list_for_each_entry_safe(tmp_aeb, _tmp_aeb, &free, u.list) {
818-
list_del(&tmp_aeb->u.list);
819-
list_add_tail(&tmp_aeb->u.list, &ai->free);
820-
}
817+
list_for_each_entry_safe(tmp_aeb, _tmp_aeb, &free, u.list)
818+
list_move_tail(&tmp_aeb->u.list, &ai->free);
821819

822820
/*
823821
* If fastmap is leaking PEBs (must not happen), raise a

0 commit comments

Comments
 (0)