Skip to content

Commit

Permalink
jfs: Simplify code
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Christophe JAILLET authored and Dave Kleikamp committed Sep 6, 2016
1 parent 7cfcd8b commit 240c518
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions fs/jfs/jfs_txnmgr.c
Original file line number Diff line number Diff line change
Expand Up @@ -2893,8 +2893,7 @@ void txQuiesce(struct super_block *sb)
* 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();
Expand Down

0 comments on commit 240c518

Please sign in to comment.