* [PATCH] bnx2fc: Simplify code
@ 2016-09-03 7:05 ` Christophe JAILLET
0 siblings, 0 replies; 7+ messages in thread
From: Christophe JAILLET @ 2016-09-03 7:05 UTC (permalink / raw)
To: QLogic-Storage-Upstream, jejb, martin.petersen
Cc: linux-scsi, linux-kernel, kernel-janitors, Christophe JAILLET
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
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH] bnx2fc: Simplify code
@ 2016-09-03 7:05 ` Christophe JAILLET
0 siblings, 0 replies; 7+ messages in thread
From: Christophe JAILLET @ 2016-09-03 7:05 UTC (permalink / raw)
To: QLogic-Storage-Upstream, jejb, martin.petersen
Cc: linux-scsi, linux-kernel, kernel-janitors, Christophe JAILLET
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
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] bnx2fc: Simplify code
2016-09-03 7:05 ` Christophe JAILLET
(?)
@ 2016-09-08 14:50 ` Chad Dupuis
-1 siblings, 0 replies; 7+ messages in thread
From: Chad Dupuis @ 2016-09-08 14:50 UTC (permalink / raw)
To: Christophe JAILLET
Cc: QLogic-Storage-Upstream, jejb, martin.petersen, linux-scsi,
linux-kernel, kernel-janitors, Dept_Linux_FC
On Sat, 3 Sep 2016, 7:05am -0000, Christophe JAILLET wrote:
> 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);
>
>
Looks ok to me.
Acked-by: Chad Dupuis <chad.dupuis@qlogic.com>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] bnx2fc: Simplify code
@ 2016-09-08 14:50 ` Chad Dupuis
0 siblings, 0 replies; 7+ messages in thread
From: Chad Dupuis @ 2016-09-08 14:50 UTC (permalink / raw)
To: Christophe JAILLET
Cc: QLogic-Storage-Upstream, jejb, martin.petersen, linux-scsi,
linux-kernel, kernel-janitors, Dept_Linux_FC
On Sat, 3 Sep 2016, 7:05am -0000, Christophe JAILLET wrote:
> 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);
>
>
Looks ok to me.
Acked-by: Chad Dupuis <chad.dupuis@qlogic.com>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] bnx2fc: Simplify code
@ 2016-09-08 14:50 ` Chad Dupuis
0 siblings, 0 replies; 7+ messages in thread
From: Chad Dupuis @ 2016-09-08 14:50 UTC (permalink / raw)
To: Christophe JAILLET
Cc: QLogic-Storage-Upstream, jejb, martin.petersen, linux-scsi,
linux-kernel, kernel-janitors, Dept_Linux_FC
On Sat, 3 Sep 2016, 7:05am -0000, Christophe JAILLET wrote:
> 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);
>
>
Looks ok to me.
Acked-by: Chad Dupuis <chad.dupuis@qlogic.com>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] bnx2fc: Simplify code
2016-09-03 7:05 ` Christophe JAILLET
@ 2016-09-09 11:06 ` Martin K. Petersen
-1 siblings, 0 replies; 7+ messages in thread
From: Martin K. Petersen @ 2016-09-09 11:06 UTC (permalink / raw)
To: Christophe JAILLET
Cc: QLogic-Storage-Upstream, jejb, martin.petersen, linux-scsi,
linux-kernel, kernel-janitors
>>>>> "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
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] bnx2fc: Simplify code
@ 2016-09-09 11:06 ` Martin K. Petersen
0 siblings, 0 replies; 7+ messages in thread
From: Martin K. Petersen @ 2016-09-09 11:06 UTC (permalink / raw)
To: Christophe JAILLET
Cc: QLogic-Storage-Upstream, jejb, martin.petersen, linux-scsi,
linux-kernel, kernel-janitors
>>>>> "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
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2016-09-09 11:07 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-03 7:05 [PATCH] bnx2fc: Simplify code Christophe JAILLET
2016-09-03 7:05 ` Christophe JAILLET
2016-09-08 14:50 ` Chad Dupuis
2016-09-08 14:50 ` Chad Dupuis
2016-09-08 14:50 ` Chad Dupuis
2016-09-09 11:06 ` Martin K. Petersen
2016-09-09 11:06 ` Martin K. Petersen
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.