linux-crypto.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tom Lendacky <thomas.lendacky@amd.com>
To: Gary R Hook <gary.hook@amd.com>, <linux-crypto@vger.kernel.org>
Cc: <herbert@gondor.apana.org.au>, <davem@davemloft.net>
Subject: Re: [PATCH] crypto: ccp - Use different flag vars for nested locks
Date: Fri, 11 Mar 2016 17:01:34 -0600	[thread overview]
Message-ID: <56E34E4E.6040504@amd.com> (raw)
In-Reply-To: <20160311163942.4791.47157.stgit@taos>

On 03/11/2016 10:40 AM, Gary R Hook wrote:
> This patch fixes a coccinelle warning about reusing a flags
> variable in nested lock acquisition.
> 
> Signed-off-by: Gary R Hook <gary.hook@amd.com>

Acked-by: Tom Lendacky <thomas.lendacky@amd.com>

> ---
>  drivers/crypto/ccp/ccp-dev.c |    6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/crypto/ccp/ccp-dev.c b/drivers/crypto/ccp/ccp-dev.c
> index 336e5b7..9c7bce8 100644
> --- a/drivers/crypto/ccp/ccp-dev.c
> +++ b/drivers/crypto/ccp/ccp-dev.c
> @@ -120,7 +120,7 @@ void ccp_del_device(struct ccp_device *ccp)
>  
>  static struct ccp_device *ccp_get_device(void)
>  {
> -	unsigned long flags;
> +	unsigned long flags, rrflags;
>  	struct ccp_device *dp = NULL;
>  
>  	/* We round-robin through the unit list.
> @@ -128,14 +128,14 @@ static struct ccp_device *ccp_get_device(void)
>  	 */
>  	read_lock_irqsave(&ccp_unit_lock, flags);
>  	if (!list_empty(&ccp_units)) {
> -		write_lock_irqsave(&ccp_rr_lock, flags);
> +		write_lock_irqsave(&ccp_rr_lock, rrflags);
>  		dp = ccp_rr;
>  		if (list_is_last(&ccp_rr->entry, &ccp_units))
>  			ccp_rr = list_first_entry(&ccp_units, struct ccp_device,
>  						  entry);
>  		else
>  			ccp_rr = list_next_entry(ccp_rr, entry);
> -		write_unlock_irqrestore(&ccp_rr_lock, flags);
> +		write_unlock_irqrestore(&ccp_rr_lock, rrflags);
>  	}
>  	read_unlock_irqrestore(&ccp_unit_lock, flags);
>  
> 

  reply	other threads:[~2016-03-12  0:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-11 16:40 [PATCH] crypto: ccp - Use different flag vars for nested locks Gary R Hook
2016-03-11 23:01 ` Tom Lendacky [this message]
2016-03-12  2:22 ` Herbert Xu
2016-03-14 14:15   ` Gary R Hook

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=56E34E4E.6040504@amd.com \
    --to=thomas.lendacky@amd.com \
    --cc=davem@davemloft.net \
    --cc=gary.hook@amd.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).