]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
UBI: use list_move_tail instead of list_del/list_add_tail
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>
Tue, 9 Oct 2012 06:14:21 +0000 (14:14 +0800)
committerArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Fri, 26 Oct 2012 13:04:21 +0000 (16:04 +0300)
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>
drivers/mtd/ubi/fastmap.c

index 1a5f53c090d40ab6f6d3a601f4b2992c61215b14..0648c6996d43a94031d135163d4a693132dcc2b4 100644 (file)
@@ -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