From patchwork Thu Jun 4 04:13:29 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiang Liu X-Patchwork-Id: 6543571 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id D4858C0020 for ; Thu, 4 Jun 2015 04:25:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D6EE3204FB for ; Thu, 4 Jun 2015 04:25:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BB2A5204EA for ; Thu, 4 Jun 2015 04:25:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754128AbbFDEYv (ORCPT ); Thu, 4 Jun 2015 00:24:51 -0400 Received: from mga09.intel.com ([134.134.136.24]:19807 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751043AbbFDEPX (ORCPT ); Thu, 4 Jun 2015 00:15:23 -0400 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP; 03 Jun 2015 21:15:21 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,549,1427785200"; d="scan'208";a="736801327" Received: from gerry-dev.bj.intel.com ([10.238.158.61]) by fmsmga002.fm.intel.com with ESMTP; 03 Jun 2015 21:15:18 -0700 From: Jiang Liu To: Thomas Gleixner , Bjorn Helgaas , Benjamin Herrenschmidt , Ingo Molnar , "H. Peter Anvin" , Randy Dunlap , Yinghai Lu , Borislav Petkov Cc: Jiang Liu , Konrad Rzeszutek Wilk , Tony Luck , x86@kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, linux-acpi@vger.kernel.org Subject: [RFT v2 19/48] genirq: Change prototypes of register_irq_proc() and friends Date: Thu, 4 Jun 2015 12:13:29 +0800 Message-Id: <1433391238-19471-20-git-send-email-jiang.liu@linux.intel.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1433391238-19471-1-git-send-email-jiang.liu@linux.intel.com> References: <1433391238-19471-1-git-send-email-jiang.liu@linux.intel.com> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Change prototypes of register_irq_proc() and friends, so we either passing 'irq' or 'irq_desc', but not both. Signed-off-by: Jiang Liu --- kernel/irq/internals.h | 18 ++++++++++-------- kernel/irq/irqdesc.c | 2 +- kernel/irq/manage.c | 8 ++++---- kernel/irq/proc.c | 16 ++++++++-------- 4 files changed, 23 insertions(+), 21 deletions(-) diff --git a/kernel/irq/internals.h b/kernel/irq/internals.h index 3d274e2fe605..ed0388b754fa 100644 --- a/kernel/irq/internals.h +++ b/kernel/irq/internals.h @@ -94,16 +94,18 @@ bool irq_wait_for_poll(struct irq_desc *desc); void __irq_wake_thread(struct irq_desc *desc, struct irqaction *action); #ifdef CONFIG_PROC_FS -extern void register_irq_proc(unsigned int irq, struct irq_desc *desc); -extern void unregister_irq_proc(unsigned int irq, struct irq_desc *desc); -extern void register_handler_proc(unsigned int irq, struct irqaction *action); -extern void unregister_handler_proc(unsigned int irq, struct irqaction *action); +extern void register_irq_proc(struct irq_desc *desc); +extern void unregister_irq_proc(struct irq_desc *desc); +extern void register_handler_proc(struct irq_desc *desc, + struct irqaction *action); +extern void unregister_handler_proc(struct irq_desc *desc, + struct irqaction *action); #else -static inline void register_irq_proc(unsigned int irq, struct irq_desc *desc) { } -static inline void unregister_irq_proc(unsigned int irq, struct irq_desc *desc) { } -static inline void register_handler_proc(unsigned int irq, +static inline void register_irq_proc(struct irq_desc *desc) { } +static inline void unregister_irq_proc(struct irq_desc *desc) { } +static inline void register_handler_proc(struct irq_desc *desc, struct irqaction *action) { } -static inline void unregister_handler_proc(unsigned int irq, +static inline void unregister_handler_proc(struct irq_desc *desc, struct irqaction *action) { } #endif diff --git a/kernel/irq/irqdesc.c b/kernel/irq/irqdesc.c index 500e6fd11d78..969f7e252846 100644 --- a/kernel/irq/irqdesc.c +++ b/kernel/irq/irqdesc.c @@ -175,7 +175,7 @@ static void free_desc(unsigned int irq) { struct irq_desc *desc = irq_to_desc(irq); - unregister_irq_proc(irq, desc); + unregister_irq_proc(desc); /* * sparse_irq_lock protects also show_interrupts() and diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c index 32567d4d7031..e478a0f25bd6 100644 --- a/kernel/irq/manage.c +++ b/kernel/irq/manage.c @@ -1293,9 +1293,9 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new) if (new->thread) wake_up_process(new->thread); - register_irq_proc(irq, desc); + register_irq_proc(desc); new->dir = NULL; - register_handler_proc(irq, new); + register_handler_proc(desc, new); free_cpumask_var(mask); return 0; @@ -1405,7 +1405,7 @@ static struct irqaction *__free_irq(unsigned int irq, void *dev_id) raw_spin_unlock_irqrestore(&desc->lock, flags); - unregister_handler_proc(irq, action); + unregister_handler_proc(desc, action); /* Make sure it's not being used on another CPU: */ synchronize_irq(irq); @@ -1712,7 +1712,7 @@ static struct irqaction *__free_percpu_irq(unsigned int irq, void __percpu *dev_ raw_spin_unlock_irqrestore(&desc->lock, flags); - unregister_handler_proc(irq, action); + unregister_handler_proc(desc, action); module_put(desc->owner); return action; diff --git a/kernel/irq/proc.c b/kernel/irq/proc.c index e3a8c9577ba6..3e2514b47367 100644 --- a/kernel/irq/proc.c +++ b/kernel/irq/proc.c @@ -301,13 +301,12 @@ static int name_unique(unsigned int irq, struct irqaction *new_action) return ret; } -void register_handler_proc(unsigned int irq, struct irqaction *action) +void register_handler_proc(struct irq_desc *desc, struct irqaction *action) { char name [MAX_NAMELEN]; - struct irq_desc *desc = irq_to_desc(irq); if (!desc->dir || action->dir || !action->name || - !name_unique(irq, action)) + !name_unique(irq_desc_get_irq(desc), action)) return; memset(name, 0, MAX_NAMELEN); @@ -321,9 +320,10 @@ void register_handler_proc(unsigned int irq, struct irqaction *action) #define MAX_NAMELEN 10 -void register_irq_proc(unsigned int irq, struct irq_desc *desc) +void register_irq_proc(struct irq_desc *desc) { char name [MAX_NAMELEN]; + unsigned int irq = irq_desc_get_irq(desc); if (!root_irq_dir || (desc->irq_data.chip == &no_irq_chip) || desc->dir) return; @@ -357,7 +357,7 @@ void register_irq_proc(unsigned int irq, struct irq_desc *desc) &irq_spurious_proc_fops, (void *)(long)irq); } -void unregister_irq_proc(unsigned int irq, struct irq_desc *desc) +void unregister_irq_proc(struct irq_desc *desc) { char name [MAX_NAMELEN]; @@ -372,13 +372,13 @@ void unregister_irq_proc(unsigned int irq, struct irq_desc *desc) remove_proc_entry("spurious", desc->dir); memset(name, 0, MAX_NAMELEN); - sprintf(name, "%u", irq); + sprintf(name, "%u", irq_desc_get_irq(desc)); remove_proc_entry(name, root_irq_dir); } #undef MAX_NAMELEN -void unregister_handler_proc(unsigned int irq, struct irqaction *action) +void unregister_handler_proc(struct irq_desc *desc, struct irqaction *action) { proc_remove(action->dir); } @@ -410,7 +410,7 @@ void init_irq_proc(void) if (!desc) continue; - register_irq_proc(irq, desc); + register_irq_proc(desc); } }