Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751308AbbFMVnC (ORCPT ); Sat, 13 Jun 2015 17:43:02 -0400 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]:63509 "EHLO mail3-relais-sop.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750793AbbFMVmu (ORCPT ); Sat, 13 Jun 2015 17:42:50 -0400 X-IronPort-AV: E=Sophos;i="5.13,610,1427752800"; d="scan'208";a="136060167" Date: Sat, 13 Jun 2015 23:42:45 +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: 3077 Lines: 103 The semantic patch below considers the problem from another point of view, to find functions that may have a handler as an argument. The results that are different than those considered already are as follows: arch/x86/platform/uv/uv_irq.c:106 irq_domain_set_info has a possible handler in argument 6 arch/sparc/kernel/leon_pci_grpci2.c:815 leon_update_virq_handling has a possible handler in argument 2 arch/sparc/kernel/leon_kernel.c:79 leon_build_device_irq has a possible handler in argument 2 arch/arm/mach-omap2/prm_common.c:331 irq_alloc_generic_chip has a possible handler in argument 5 arch/mips/cavium-octeon/octeon-irq.c:1231 octeon_irq_set_ciu_mapping has a possible handler in argument 6 arch/blackfin/mach-common/ints-priority.c:805 bfin_set_irq_handler has a possible handler in argument 2 arch/m68k/q40/q40ints.c:84 m68k_setup_irq_controller has a possible handler in argument 2 drivers/gpio/gpio-pcf857x.c:362 gpiochip_irqchip_add has a possible handler in argument 4 The semantic patch looks for a function that has as argument a function that has arguments of type (unsigned int irq, struct irq_desc *desc) and a void return type. It also looks for functions that have as argument a bunch of known irq handlers. julia @initialize:ocaml@ @@ let tbl = Hashtbl.create 101 let ln = Str.regexp "linux-next/" (* update as appropriate *) let _ = List.iter (function x -> Hashtbl.add tbl x ()) [("__irq_set_handler",2);("irq_set_handler",2); ("irq_set_chained_handler",2);("irq_alloc_generic_chip",4); ("irq_alloc_domain_generic_chips",5);("irq_set_chip_and_handler_name",3); ("irq_set_chip_and_handler",3);("__irq_set_handler_locked",2); ("__irq_set_chip_handler_name_locked",3);("__irq_set_preflow_handler",2); ("gpiochip_set_chained_irqchip",4)] let update g f n p = let n = n + 1 in let entry = (g,n) in try let _ = Hashtbl.find tbl entry in () with Not_found -> begin Hashtbl.add tbl entry (); let p = List.hd p in Printf.printf "%s:%d %s\n\thas a possible handler in argument %d\n" (List.nth (Str.split ln p.file) 1) p.line g n end @possible_handler@ identifier f,irq,desc; @@ void f(unsigned int irq, struct irq_desc *desc) { ... } @call@ identifier g,possible_handler.f; expression list[n] es; position p; @@ g(es,f@p,...) @script:ocaml@ p << call.p; f << possible_handler.f; g << call.g; n << call.n; @@ update g f n p @call2@ identifier g,f; expression list[n] es; position p; symbol handle_level_irq,handle_simple_irq,handle_edge_irq, handle_fasteoi_irq,handle_percpu_irq; @@ g(es,\(handle_level_irq@f@p\|handle_simple_irq@f@p\|handle_edge_irq@f@p\| handle_fasteoi_irq@f@p\|handle_percpu_irq@f@p\),...) @script:ocaml@ p << call2.p; f << call2.f; g << call2.g; n << call2.n; @@ update g f n p -- 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/