From patchwork Sat Sep 3 05:34:38 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 9311887 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 181A8608A0 for ; Sat, 3 Sep 2016 05:34:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0782D2818E for ; Sat, 3 Sep 2016 05:34:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E79F3284D5; Sat, 3 Sep 2016 05:34:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7B150284D5 for ; Sat, 3 Sep 2016 05:34:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753600AbcICFev (ORCPT ); Sat, 3 Sep 2016 01:34:51 -0400 Received: from smtp05.smtpout.orange.fr ([80.12.242.127]:51050 "EHLO smtp.smtpout.orange.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751581AbcICFet (ORCPT ); Sat, 3 Sep 2016 01:34:49 -0400 Received: from localhost.localdomain ([92.140.166.52]) by mwinf5d81 with ME id etah1t005189VV003tahNY; Sat, 03 Sep 2016 07:34:41 +0200 X-ME-Helo: localhost.localdomain X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sat, 03 Sep 2016 07:34:41 +0200 X-ME-IP: 92.140.166.52 From: Christophe JAILLET To: viro@zeniv.linux.org.uk Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET Subject: [PATCH] fs/pnode.c: Simplify code Date: Sat, 3 Sep 2016 07:34:38 +0200 Message-Id: <1472880878-29273-1-git-send-email-christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.7.4 X-Antivirus: avast! (VPS 160902-5, 03/09/2016), Outbound message X-Antivirus-Status: Clean Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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->mnt_slave_list, mnt_slave) slave_mnt->mnt_master = master; list_move(&mnt->mnt_slave, &master->mnt_slave_list); - list_splice(&mnt->mnt_slave_list, master->mnt_slave_list.prev); - INIT_LIST_HEAD(&mnt->mnt_slave_list); + list_splice_init(&mnt->mnt_slave_list, + master->mnt_slave_list.prev); } else { struct list_head *p = &mnt->mnt_slave_list; while (!list_empty(p)) {