[PATCH] fs/pnode.c: Simplify code
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--- fs/pnode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/pnode.c b/fs/pnode.c index 99899705b105..3d3513ee4380 100644 --- a/fs/pnode.c +++ b/fs/pnode.c @@ -97,8 +97,8 @@ static int do_make_slave(struct mount *mnt) list_for_each_entry(slave_mnt, >mnt_slave_list, mnt_slave) slave_mnt->mnt_master = master; list_move(>mnt_slave, >mnt_slave_list); - list_splice(>mnt_slave_list, master->mnt_slave_list.prev); - INIT_LIST_HEAD(>mnt_slave_list); + list_splice_init(>mnt_slave_list, +master->mnt_slave_list.prev); } else { struct list_head *p = >mnt_slave_list; while (!list_empty(p)) { -- 2.7.4
[PATCH] fs/pnode.c: Simplify code
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 --- fs/pnode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/pnode.c b/fs/pnode.c index 99899705b105..3d3513ee4380 100644 --- a/fs/pnode.c +++ b/fs/pnode.c @@ -97,8 +97,8 @@ static int do_make_slave(struct mount *mnt) list_for_each_entry(slave_mnt, >mnt_slave_list, mnt_slave) slave_mnt->mnt_master = master; list_move(>mnt_slave, >mnt_slave_list); - list_splice(>mnt_slave_list, master->mnt_slave_list.prev); - INIT_LIST_HEAD(>mnt_slave_list); + list_splice_init(>mnt_slave_list, +master->mnt_slave_list.prev); } else { struct list_head *p = >mnt_slave_list; while (!list_empty(p)) { -- 2.7.4