Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751784AbbFXVow (ORCPT ); Wed, 24 Jun 2015 17:44:52 -0400 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]:23114 "EHLO mail3-relais-sop.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750865AbbFXVon (ORCPT ); Wed, 24 Jun 2015 17:44:43 -0400 X-IronPort-AV: E=Sophos;i="5.13,673,1427752800"; d="scan'208";a="137701582" Date: Wed, 24 Jun 2015 23:44:38 +0200 (CEST) From: Julia Lawall X-X-Sender: jll@localhost6.localdomain6 To: Thomas Gleixner cc: Julia Lawall , Jiang Liu , Bjorn Helgaas , Benjamin Herrenschmidt , Ingo Molnar , "H. Peter Anvin" , "Rafael J. Wysocki" , Randy Dunlap , Yinghai Lu , Borislav Petkov , Jason Cooper , Kevin Cernekee , Arnd Bergmann , Marc Zyngier , Konrad Rzeszutek Wilk , Tony Luck , x86@kernel.org, LKML , linux-pci@vger.kernel.org, linux-acpi@vger.kernel.org Subject: Re: [RFC v1 14/25] genirq: Kill the first parameter 'irq' of irq_flow_handler_t In-Reply-To: Message-ID: References: <1432116013-25902-1-git-send-email-jiang.liu@linux.intel.com> <1432116013-25902-15-git-send-email-jiang.liu@linux.intel.com> <555CA834.7080807@linux.intel.com> <557C5F29.7010301@linux.intel.com> User-Agent: Alpine 2.02 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1753 Lines: 72 > 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/