mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Chad Dupuis <chad.dupuis@qlogic.com>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Cc: <QLogic-Storage-Upstream@qlogic.com>, <jejb@linux.vnet.ibm.com>,
	<martin.petersen@oracle.com>, <linux-scsi@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <kernel-janitors@vger.kernel.org>,
	<Dept_Linux_FC@qlogic.com>
Subject: Re: [PATCH] bnx2fc: Simplify code
Date: Thu, 8 Sep 2016 10:50:03 -0400	[thread overview]
Message-ID: <alpine.OSX.2.00.1609081049290.1086@administrators-macbook-pro.local> (raw)
In-Reply-To: <1472886348-29813-1-git-send-email-christophe.jaillet@wanadoo.fr>


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>

  reply	other threads:[~2016-09-08 15:23 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-03  7:05 Christophe JAILLET
2016-09-08 14:50 ` Chad Dupuis [this message]
2016-09-09 11:06 ` Martin K. Petersen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.OSX.2.00.1609081049290.1086@administrators-macbook-pro.local \
    --to=chad.dupuis@qlogic.com \
    --cc=Dept_Linux_FC@qlogic.com \
    --cc=QLogic-Storage-Upstream@qlogic.com \
    --cc=christophe.jaillet@wanadoo.fr \
    --cc=jejb@linux.vnet.ibm.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®