Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1171686

Re: [RFC v1 14/25] genirq: Kill the first parameter 'irq' of irq_flow_handler_t

From Julia Lawall <julia.lawall@lip6.fr>
Newsgroups linux.kernel
Subject Re: [RFC v1 14/25] genirq: Kill the first parameter 'irq' of irq_flow_handler_t
Date 2015-06-24 23:50 +0200
Message-ID <pF0Iq-5nr-17@gated-at.bofh.it> (permalink)
References (9 earlier) <pAWWK-1ZU-13@gated-at.bofh.it> <pB04h-6HD-1@gated-at.bofh.it> <pB0nD-74v-1@gated-at.bofh.it> <pB0xk-7g0-1@gated-at.bofh.it> <pF0fn-4NA-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


> Now where my cocci foo ends is when I try to match both types in the
> same rule, i.e. 
> 
> @ fun exists @
> identifier hf,irq,desc;
> typedef u32;
> @@
> 
> (
> void hf(unsigned irq, struct irq_desc *desc) { ... }
> |
> void hf(u32 irq, struct irq_desc *desc) { ... }
> )
> 
> results in:
> Fatal error: exception Failure("minus: parse error: 
>  = File "../cocci/find-pot-handler.cocci", line 7, column 5,  charpos = 63
>     around = 'hf', whole content = void hf(unsigned irq, struct irq_desc *desc) { ... }
> ")

Yeah, sorry, it doesn't work.  There is no way to put a disjunction on
a function definition or a parameter type.

> I tried a couple of other variants, but finally gave up and ran a
> cocci script first which does s/u32/unsigned/ on those functions, but
> of course because I'm lazy I wanted to do everything in one go. :)
> 
> Aside of that the ruleset you gave me works nicely except for that
> part:
> 
> // no uses of the first parameter before the assignment
> @@
> identifier fun.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
> }
> 
> That lacks a:
> 
> + unsigned int irq;
> 
> and therefor missed to add the local variable 'unsigned int irq' in
> case the parameter is only used for local storage.

Oops, thanks.

julia

> That was simple enough to fix even for me :)
> 
> Thanks,
> 
> 	tglx
> 
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

Re: [RFC v1 14/25] genirq: Kill the first parameter 'irq' of  irq_flow_handler_t Julia Lawall <julia.lawall@lip6.fr> - 2015-06-24 23:50 +0200

csiph-web