[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.10.1506131603151.2314@hadrien>
Date: Sat, 13 Jun 2015 16:04:21 +0200 (CEST)
From: Julia Lawall <julia.lawall@...6.fr>
To: Thomas Gleixner <tglx@...utronix.de>
cc: Julia Lawall <julia.lawall@...6.fr>,
Jiang Liu <jiang.liu@...ux.intel.com>,
Bjorn Helgaas <bhelgaas@...gle.com>,
Benjamin Herrenschmidt <benh@...nel.crashing.org>,
Ingo Molnar <mingo@...hat.com>,
"H. Peter Anvin" <hpa@...or.com>,
"Rafael J. Wysocki" <rjw@...ysocki.net>,
Randy Dunlap <rdunlap@...radead.org>,
Yinghai Lu <yinghai@...nel.org>,
Borislav Petkov <bp@...en8.de>,
Jason Cooper <jason@...edaemon.net>,
Kevin Cernekee <cernekee@...il.com>,
Arnd Bergmann <arnd@...db.de>,
Marc Zyngier <marc.zyngier@....com>,
Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>,
Tony Luck <tony.luck@...el.com>, x86@...nel.org,
LKML <linux-kernel@...r.kernel.org>, linux-pci@...r.kernel.org,
linux-acpi@...r.kernel.org
Subject: Re: [RFC v1 14/25] genirq: Kill the first parameter 'irq' of
irq_flow_handler_t
A new version of the semantic patch is below. The results are attached.
julia
virtual after_start
@initialize:ocaml@
@@
let tbl = Hashtbl.create(100)
let ltbl = Hashtbl.create(100)
let add_if_not_present f p =
try let _ = Hashtbl.find tbl f in ()
with Not_found ->
Hashtbl.add tbl f p;
let it = new iteration() in
it#add_virtual_rule After_start;
it#add_virtual_identifier Hf f;
it#register()
let local_add_if_not_present f file =
try let _ = Hashtbl.find ltbl (f,file) in ()
with Not_found ->
Hashtbl.add ltbl (f,file) ();
let it = new iteration() in
it#set_files [file];
it#add_virtual_rule After_start;
it#add_virtual_identifier Hf f;
it#register()
// ------------------------------------------------------------------------
// Getting started
@h depends on !after_start@
identifier ih != NULL;
local idexpression lih;
expression eh;
expression e1,e2,e3,e4,e5,e6,e7;
position p;
@@
(
__irq_set_handler@p(e1,\(lih\|ih\|eh\),e2,e3)
|
irq_set_handler@p(e1,\(lih\|ih\|eh\))
|
irq_set_chained_handler@p(e1,\(lih\|ih\|eh\))
|
irq_alloc_generic_chip@p(e1,e2,e3,\(lih\|ih\|eh\))
|
irq_alloc_domain_generic_chips@p(e1,e2,e3,e4,\(lih\|ih\|eh\),e5,e6,e7)
|
irq_set_chip_and_handler_name@p(e1,e2,\(lih\|ih\|eh\),e3)
|
irq_set_chip_and_handler@p(e1,e2,\(lih\|ih\|eh\))
|
__irq_set_handler_locked@p(e1,\(lih\|ih\|eh\))
|
__irq_set_chip_handler_name_locked@p(e1,e2,\(lih\|ih\|eh\),e3)
|
__irq_set_preflow_handler@p(e1,\(lih\|ih\|eh\))
)
@localfn@
identifier h.ih;
@@
ih(...) { ... }
@script:ocaml depends on !localfn@
p << h.p;
handler << h.ih;
@@
add_if_not_present handler p
@script:ocaml depends on localfn@
p << h.p;
handler << h.ih;
@@
local_add_if_not_present handler (List.hd p).file
@script:ocaml@
p << h.p;
handler << h.lih;
@@
Printf.eprintf "Local variable: %s:%d %s\n"
((List.hd p).file) ((List.hd p).line) handler
@script:ocaml@
p << h.p;
handler << h.eh;
@@
if not (handler = "NULL")
then Printf.eprintf "Arbitrary expression: %s:%d %s\n"
((List.hd p).file) ((List.hd p).line) handler
// ------------------------------------------------------------------------
// Adjusting functions
@@
identifier virtual.hf,irq;
fresh identifier firq = "__" ## irq;
type T;
@@
hf(T
- irq
+ firq
,...) {
... when != irq
when strict
}
@s@
identifier virtual.hf,irq;
position p1;
type T;
@@
hf(T irq,...) {
<...
(irq@p1 = <+...irq...+>)
...>
}
@s1@
identifier virtual.hf,irq;
position p1;
expression e;
statement S;
type T;
@@
hf(T irq,...) {
<...
for(...; ...; <+...irq@p1 = e...+>) S
...>
}
// first parameter is assigned at least once
@r exists@
identifier virtual.hf,irq;
expression e;
type T;
position p,p1 != {s.p1,s1.p1};
@@
hf(T@p irq,...) {
... when != irq
when strict
irq@p1 = e
... when any
}
// no uses of the first parameter before the assignment
@@
identifier virtual.hf,irq;
expression e;
type T;
fresh identifier firq = "__" ## irq;
position r.p,p1 != {s.p1,s1.p1};
@@
hf(T@p
- irq
+ firq
,...) {
... when != irq
when strict
? irq@p1 = e
... when any
}
// first parameter is used somewhere
@rr exists@
identifier virtual.hf,irq;
type T;
position p;
@@
hf(T@p irq,...) {
...
irq
... when any
}
@@
identifier virtual.hf,irq,desc;
fresh identifier firq = "__" ## irq;
type T,T1;
position rr.p;
@@
hf(T@p
- irq
+ firq
,T1 desc) {
+ unsigned int irq = irq_desc_get_irq(desc);
... when any
}
View attachment "irq_handler.out" of type "TEXT/PLAIN" (85973 bytes)
Powered by blists - more mailing lists