From patchwork Thu Apr 13 07:06:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 9678811 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4A748601C3 for ; Thu, 13 Apr 2017 07:07:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3BAEB2862C for ; Thu, 13 Apr 2017 07:07:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2D60128639; Thu, 13 Apr 2017 07:07:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AFE042862C for ; Thu, 13 Apr 2017 07:07:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753286AbdDMHHH (ORCPT ); Thu, 13 Apr 2017 03:07:07 -0400 Received: from bombadil.infradead.org ([65.50.211.133]:58058 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752689AbdDMHHG (ORCPT ); Thu, 13 Apr 2017 03:07:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=References:In-Reply-To:Message-Id: Date:Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=QkkTGu3sDlRlefgqjS5N6/JqHrIG1h9afBh7L+pJo6Q=; b=euFtD8NnOjGJ+8634WD0B8MD7 SI4vykJNh+1alna9aVrpkJpKMLB17C8Z0eb3EnDOJ0DyFqQJ5/+tGXuPB/oajZWLzwCV9+Zc3NrE5 HQsMEdy+brXGCShzY9/z8vlZ11aEJsVXMoc/Ccvu7ZqDIkm0EO7+1f/O6Hdqsx8kzchgU5Yg5h+qJ PUW9Uj4HZo60NvcZJgxNliXkz4EeixVRy6l6VhG9H6mrDMDyuTVuwEkP3MGTwagxhdrLrIPkugcce uTC6dUIqph+GFKTXi359iC2PJa82Riv2upnkkXnfdafq+skPo1h3w/xAwbZW1Zc5+rE7w2F2VwOYa m1e7Dofkw==; Received: from 212095007060.public.telering.at ([212.95.7.60] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.87 #1 (Red Hat Linux)) id 1cyYqI-0005xr-Ml; Thu, 13 Apr 2017 07:06:59 +0000 From: Christoph Hellwig To: Thomas Gleixner , Bjorn Helgaas Cc: linux-pci@vger.kernel.org, linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/4] genirq: return the irq name from free_irq Date: Thu, 13 Apr 2017 09:06:41 +0200 Message-Id: <20170413070643.32165-3-hch@lst.de> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170413070643.32165-1-hch@lst.de> References: <20170413070643.32165-1-hch@lst.de> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This allows callers to get back at them instead of having to store it in another variable. Signed-off-by: Christoph Hellwig --- include/linux/interrupt.h | 2 +- kernel/irq/manage.c | 13 ++++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h index 53144e78a369..a6fba4804672 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h @@ -155,7 +155,7 @@ extern int __must_check request_percpu_irq(unsigned int irq, irq_handler_t handler, const char *devname, void __percpu *percpu_dev_id); -extern void free_irq(unsigned int, void *); +extern const void *free_irq(unsigned int, void *); extern void free_percpu_irq(unsigned int, void __percpu *); struct device; diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c index 391cb738b2db..e688e7e06772 100644 --- a/kernel/irq/manage.c +++ b/kernel/irq/manage.c @@ -1574,20 +1574,27 @@ EXPORT_SYMBOL_GPL(remove_irq); * have completed. * * This function must not be called from interrupt context. + * + * Returns the devname argument passed to request_irq. */ -void free_irq(unsigned int irq, void *dev_id) +const void *free_irq(unsigned int irq, void *dev_id) { struct irq_desc *desc = irq_to_desc(irq); + struct irqaction *action; + const char *devname; if (!desc || WARN_ON(irq_settings_is_per_cpu_devid(desc))) - return; + return NULL; #ifdef CONFIG_SMP if (WARN_ON(desc->affinity_notify)) desc->affinity_notify = NULL; #endif - kfree(__free_irq(irq, dev_id)); + action = __free_irq(irq, dev_id); + devname = action->name; + kfree(action); + return devname; } EXPORT_SYMBOL(free_irq);