From patchwork Fri Nov 21 03:23:26 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiang Liu X-Patchwork-Id: 5352551 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 3F134C11AC for ; Fri, 21 Nov 2014 03:23:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7CB7A2018E for ; Fri, 21 Nov 2014 03:23:13 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6FBBB2016C for ; Fri, 21 Nov 2014 03:23:12 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Xrelw-0004Co-QP; Fri, 21 Nov 2014 03:20:36 +0000 Received: from mga09.intel.com ([134.134.136.24]) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Xrelt-00049o-Tn for linux-arm-kernel@lists.infradead.org; Fri, 21 Nov 2014 03:20:34 +0000 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 20 Nov 2014 19:17:57 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.07,428,1413270000"; d="scan'208";a="640907592" Received: from gerry-dev.bj.intel.com ([10.238.158.52]) by orsmga002.jf.intel.com with ESMTP; 20 Nov 2014 19:20:07 -0800 From: Jiang Liu To: Thomas Gleixner , Ingo Molnar , Grant Likely , Marc Zyngier , Yijing Wang , Yingjoe Chen , Suravee Suthikulpanit , Borislav Petkov , "H. Peter Anvin" , Benjamin Herrenschmidt , Matthias Brugger Subject: [Patch irqdomain: Enhance irq_domain_free_irqs_common() to support parentless irqdomain Date: Fri, 21 Nov 2014 11:23:26 +0800 Message-Id: <1416540206-18103-1-git-send-email-jiang.liu@linux.intel.com> X-Mailer: git-send-email 1.7.10.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141120_192034_016146_294EB972 X-CRM114-Status: GOOD ( 11.79 ) X-Spam-Score: -5.0 (-----) Cc: linux-pci@vger.kernel.org, Tony Luck , Jiang Liu , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, 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 Originally irq_domain_free_irqs_common() is designed to be used by irqdomains with parent. But there are desires to reuse for parentless irqdomains for code reduction. So check domain->parent before invoking irq_domain_free_irqs_parent(). Signed-off-by: Jiang Liu --- Hi Thomas, This patch applies to tip/irq/irqdomain, it helps to reduce code size on ARM. Seems we still have chance to merge it into tip/irq/irqdomain:) Regards! Gerry --- kernel/irq/irqdomain.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c index 029acf11efed..0449d2869e17 100644 --- a/kernel/irq/irqdomain.c +++ b/kernel/irq/irqdomain.c @@ -975,7 +975,8 @@ void irq_domain_free_irqs_common(struct irq_domain *domain, unsigned int virq, if (irq_data) irq_domain_reset_irq_data(irq_data); } - irq_domain_free_irqs_parent(domain, virq, nr_irqs); + if (domain->parent) + irq_domain_free_irqs_parent(domain, virq, nr_irqs); } /**