Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1475564 > unrolled thread

[PATCH] bnx2fc: Simplify code

Started byChristophe JAILLET <christophe.jaillet@wanadoo.fr>
First post2016-09-03 09:10 +0200
Last post2016-09-09 13:10 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] bnx2fc: Simplify code Christophe JAILLET <christophe.jaillet@wanadoo.fr> - 2016-09-03 09:10 +0200
    Re: [PATCH] bnx2fc: Simplify code "Martin K. Petersen" <martin.petersen@oracle.com> - 2016-09-09 13:10 +0200

#1475564 — [PATCH] bnx2fc: Simplify code

FromChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Date2016-09-03 09:10 +0200
Subject[PATCH] bnx2fc: Simplify code
Message-ID<sddfs-28M-7@gated-at.bofh.it>
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>
---
 drivers/scsi/bnx2fc/bnx2fc_fcoe.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c
index a5052dd8d7e6..88be12a02764 100644
--- a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c
+++ b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c
@@ -2765,8 +2765,7 @@ static void __exit bnx2fc_mod_exit(void)
 	 * held.
 	 */
 	mutex_lock(&bnx2fc_dev_lock);
-	list_splice(&adapter_list, &to_be_deleted);
-	INIT_LIST_HEAD(&adapter_list);
+	list_splice_init(&adapter_list, &to_be_deleted);
 	adapter_count = 0;
 	mutex_unlock(&bnx2fc_dev_lock);
 
-- 
2.7.4

[toc] | [next] | [standalone]


#1479871

From"Martin K. Petersen" <martin.petersen@oracle.com>
Date2016-09-09 13:10 +0200
Message-ID<sfrQZ-24u-11@gated-at.bofh.it>
In reply to#1475564
>>>>> "Christophe" == Christophe JAILLET <christophe.jaillet@wanadoo.fr> writes:

Christophe> Calling 'list_splice' followed by 'INIT_LIST_HEAD' is
Christophe> equivalent to 'list_splice_init'.

Applied to 4.9/scsi-queue.

-- 
Martin K. Petersen	Oracle Linux Engineering

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web