kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jesper Nilsson <jesper.nilsson@axis.com>
To: Julia Lawall <julia@diku.dk>
Cc: mikael.starvik@axis.com, dev-etrax@axis.com,
	linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] arch/cris: Use mutex_unlock rather than spin_unlock
Date: Thu, 06 Mar 2008 18:08:04 +0000	[thread overview]
Message-ID: <20080306180804.GJ27716@axis.com> (raw)
In-Reply-To: <Pine.LNX.4.58.0803061823370.1669@pc-041.diku.dk>

On Thu, Mar 06, 2008 at 06:24:05PM +0100, Julia Lawall wrote:
> From: Julia Lawall <julia@diku.dk>
> 
> It looks at least odd to apply spin_unlock to a mutex.
> 
> The semantic patch that makes this change is as follows:
> (http://www.emn.fr/x-info/coccinelle/)
> 
> // <smpl>
> @def@
> declarer DEFINE_MUTEX;
> identifier m;
> @@
> 
> DEFINE_MUTEX(m);
> 
> @@
> identifier def.m;
> @@
> 
> (
> - spin_lock(&m)
> + mutex_lock(&m)
> |
> - spin_unlock(&m)
> + mutex_unlock(&m)
> )
> // </smpl>
> 
> Signed-off-by: Julia Lawall <julia@diku.dk>
> 
> ---
>  arch/cris/arch-v10/drivers/pcf8563.c |    2 +-
>  arch/cris/arch-v32/drivers/pcf8563.c |    2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff -u -p a/arch/cris/arch-v10/drivers/pcf8563.c b/arch/cris/arch-v10/drivers/pcf8563.c
> --- a/arch/cris/arch-v10/drivers/pcf8563.c 2008-02-10 22:34:04.000000000 +0100
> +++ b/arch/cris/arch-v10/drivers/pcf8563.c 2008-03-05 22:06:18.000000000 +0100
> @@ -233,7 +233,7 @@ int pcf8563_ioctl(struct inode *inode, s
> 
>  		if (copy_to_user((struct rtc_time *) arg, &tm,
>  				 sizeof tm)) {
> -			spin_unlock(&rtc_lock);
> +			mutex_unlock(&rtc_lock);
>  			return -EFAULT;
>  		}
> 
> diff -u -p a/arch/cris/arch-v32/drivers/pcf8563.c b/arch/cris/arch-v32/drivers/pcf8563.c
> --- a/arch/cris/arch-v32/drivers/pcf8563.c 2008-02-10 22:34:04.000000000 +0100
> +++ b/arch/cris/arch-v32/drivers/pcf8563.c 2008-03-05 22:06:18.000000000 +0100
> @@ -229,7 +229,7 @@ int pcf8563_ioctl(struct inode *inode, s
> 
>  		if (copy_to_user((struct rtc_time *) arg, &tm,
>  				 sizeof tm)) {
> -			spin_unlock(&rtc_lock);
> +			mutex_unlock(&rtc_lock);
>  			return -EFAULT;
>  		}
> 

Quite correct, I'll add it to my queue.

Thanks,

/^JN - Jesper Nilsson
--
               Jesper Nilsson -- jesper.nilsson@axis.com

      reply	other threads:[~2008-03-06 18:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-06 17:24 [PATCH] arch/cris: Use mutex_unlock rather than spin_unlock Julia Lawall
2008-03-06 18:08 ` Jesper Nilsson [this message]

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=20080306180804.GJ27716@axis.com \
    --to=jesper.nilsson@axis.com \
    --cc=dev-etrax@axis.com \
    --cc=julia@diku.dk \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mikael.starvik@axis.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;
as well as URLs for NNTP newsgroup(s).