jfs: Simplify code
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Sat, 3 Sep 2016 05:35:29 +0000 (07:35 +0200)
committerDave Kleikamp <dave.kleikamp@oracle.com>
Tue, 6 Sep 2016 17:17:24 +0000 (12:17 -0500)
Calling 'list_splice' followed by 'INIT_LIST_HEAD' is equivalent to
'list_splice_init'.

This has been spotted with the following coccinelle script:
/////
@@
expression y,z;
@@

-   list_splice(y,z);
-   INIT_LIST_HEAD(y);
+   list_splice_init(y,z);

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>
fs/jfs/jfs_txnmgr.c

index 2e58978..4d97352 100644 (file)
@@ -2893,8 +2893,7 @@ restart:
         * on anon_list2.  Let's check.
         */
        if (!list_empty(&TxAnchor.anon_list2)) {
-               list_splice(&TxAnchor.anon_list2, &TxAnchor.anon_list);
-               INIT_LIST_HEAD(&TxAnchor.anon_list2);
+               list_splice_init(&TxAnchor.anon_list2, &TxAnchor.anon_list);
                goto restart;
        }
        TXN_UNLOCK();