dect
/
linux-2.6
Archived
13
0
Fork 0

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>
Signed-off-by: Jesper Nilsson <jesper.nilsson@axis.com>
This commit is contained in:
Julia Lawall 2008-06-29 22:50:56 +02:00 committed by Jesper Nilsson
parent 543cf4cb3f
commit 9be48a94b8
2 changed files with 2 additions and 2 deletions

View File

@ -233,7 +233,7 @@ int pcf8563_ioctl(struct inode *inode, struct file *filp, unsigned int cmd,
if (copy_to_user((struct rtc_time *) arg, &tm,
sizeof tm)) {
spin_unlock(&rtc_lock);
mutex_unlock(&rtc_lock);
return -EFAULT;
}

View File

@ -229,7 +229,7 @@ int pcf8563_ioctl(struct inode *inode, struct file *filp, unsigned int cmd,
if (copy_to_user((struct rtc_time *) arg, &tm,
sizeof tm)) {
spin_unlock(&rtc_lock);
mutex_unlock(&rtc_lock);
return -EFAULT;
}