]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit - drivers/staging/dgnc/dgnc_tty.c
staging: dgnc: dgnc_tty.c: Replace non-standard spinlock's macros
authorRoberta Dobrescu <roberta.dobrescu@gmail.com>
Fri, 26 Sep 2014 20:58:37 +0000 (23:58 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 29 Sep 2014 02:52:12 +0000 (22:52 -0400)
commita44b508a32aed3a5e6af1468753886ba4d216a8c
treea1ffcad448036171680e6dafb3b812afc3cd60c5
parent9a03d7c8cf8b244c3d66da2ce65c170013eeba56
staging: dgnc: dgnc_tty.c: Replace non-standard spinlock's macros

This patch replaces non-standard spinlock's macros.
It is done using coccinelle and the following semantic patch:

@@
expression x;
@@

- DGNC_SPINLOCK_INIT(x)
+ spin_lock_init(&x)

@@
expression x, y;
@@

- DGNC_LOCK(x, y)
+ spin_lock_irqsave(&x, y)

@@
expression x, y;
@@

- DGNC_UNLOCK(x, y)
+ spin_unlock_irqrestore(&x, y)

@used_by_lock exists@
typedef ulong;
symbol lock_flags;
position p1, p2;
@@

(
 ulong lock_flags@p1;
|
 unsigned long lock_flags@p2;
)
...
(
 spin_lock_irqsave(..., lock_flags)
|
 spin_unlock_irqrestore(..., lock_flags)
)

@@
position used_by_lock.p1, used_by_lock.p2;
@@

(
- ulong lock_flags@p1;
+ unsigned long flags;
|
- unsigned long lock_flags@p2;
+ unsigned long flags;
)
<...
- lock_flags
+ flags
...>

Signed-off-by: Roberta Dobrescu <roberta.dobrescu@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/dgnc/dgnc_tty.c