Skip to content

Commit

Permalink
It looks at least odd to apply spin_unlock to a mutex.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Julia Lawall authored and Jesper Nilsson committed Jun 29, 2008
1 parent 543cf4c commit 9be48a9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion arch/cris/arch-v10/drivers/pcf8563.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion arch/cris/arch-v32/drivers/pcf8563.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 9be48a9

Please sign in to comment.