[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.64.1003212016040.12371@ask.diku.dk>
Date: Sun, 21 Mar 2010 20:16:31 +0100 (CET)
From: Julia Lawall <julia@...u.dk>
To: "Eric W. Biederman" <ebiederm@...ssion.com>
Cc: Thomas Gleixner <tglx@...utronix.de>,
Yinghai Lu <yinghai@...nel.org>, Ingo Molnar <mingo@...e.hu>,
"H. Peter Anvin" <hpa@...or.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Suresh Siddha <suresh.b.siddha@...el.com>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 06/12] genericirq: make irq_chip related function to take
desc
Here is my semantic patch:
// -----------------------------------------------------------------------
// find functions
@ignore@
struct irq_chip i;
identifier x;
local idexpression l;
position p;
@@
i.x@p = \(NULL\|l\);
@r@
struct irq_chip i;
identifier x!={name,typename},fn;
position p!=ignore.p;
@@
i.x@p = fn;
// -----------------------------------------------------------------------
// normalize code
@@
expression irq;
@@
(
- irq_desc + irq
+ irq_to_desc(irq)
|
- &irq_desc[irq]
+ irq_to_desc(irq)
)
// -----------------------------------------------------------------------
// find their calls
@@
identifier r.fn;
expression irq;
@@
fn(
- irq
+ irq_to_desc(irq)
,...)
@@
struct irq_chip *ic;
struct irq_desc *desc;
identifier fun != {name,typename};
expression irq;
@@
\(ic\|desc->chip\)->fun(
- irq
+ irq_to_desc(irq)
,...)
// -----------------------------------------------------------------------
// find their definitions
@unused@
identifier r.fn,irq;
type T;
@@
fn(
- T irq
+ struct irq_desc *unused
, ...) {
... when != irq
when != unused
when strict
}
@with_desc@
identifier r.fn,irqv,desc;
type T;
@@
fn(
- T irqv
+ struct irq_desc *desc
, ...) {
+ unsigned int irqv = desc->irq;
...
(
- struct irq_desc *desc = irq_to_desc(irqv);
|
- struct irq_desc *desc;
...
- desc = irq_to_desc(irqv);
)
...
}
@depends on !unused && !with_desc@
identifier r.fn,irqv;
type T;
@@
fn(
- T irqv
+ struct irq_desc *desc
, ...) {
+ unsigned int irqv = desc->irq;
... when != desc
when strict
}
// -----------------------------------------------------------------------
// simplify definitions
@@
struct irq_desc *desc;
expression irq,E1,E2;
@@
desc = irq_to_desc(irq)
<...
- irq_to_desc(irq)
+ desc
...>
(
return;
|
desc = E1
|
?irq = E2
)
@@
identifier r.fn,irqv,desc,fld;
@@
fn(struct irq_desc *desc, ...) {
unsigned int irqv = desc->irq;
<...
(
- irq_to_desc(irqv)
+ desc
|
- irq_desc[irqv].fld
+ desc->fld
)
...>
}
@@
struct irq_desc *desc;
@@
- desc = desc;
@@
identifier r.fn,irqv,desc;
@@
fn(struct irq_desc *desc, ...) {
- unsigned int irqv = desc->irq;
... when != irqv
when strict
}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists