From patchwork Fri Dec 3 23:37:27 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 379371 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oB3NcRkC015429 for ; Fri, 3 Dec 2010 23:38:27 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754135Ab0LCXhj (ORCPT ); Fri, 3 Dec 2010 18:37:39 -0500 Received: from fmmailgate03.web.de ([217.72.192.234]:32792 "EHLO fmmailgate03.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753448Ab0LCXhh (ORCPT ); Fri, 3 Dec 2010 18:37:37 -0500 Received: from smtp07.web.de ( [172.20.5.215]) by fmmailgate03.web.de (Postfix) with ESMTP id 47CBB17B5FF24; Sat, 4 Dec 2010 00:37:36 +0100 (CET) Received: from [92.75.140.225] (helo=localhost.localdomain) by smtp07.web.de with asmtp (TLSv1:AES256-SHA:256) (WEB.DE 4.110 #24) id 1POfC4-0002I9-00; Sat, 04 Dec 2010 00:37:36 +0100 From: Jan Kiszka To: Thomas Gleixner , Avi Kivity , Marcelo Tosatti Cc: linux-kernel@vger.kernel.org, kvm , Tom Lyon , Alex Williamson , "Michael S. Tsirkin" , Jan Kiszka Subject: [PATCH 1/5] genirq: Pass descriptor to __free_irq Date: Sat, 4 Dec 2010 00:37:27 +0100 Message-Id: <26d120c867374ef2b16d2432ca9a77fed11c230b.1291419444.git.jan.kiszka@web.de> X-Mailer: git-send-email 1.7.1 In-Reply-To: References: In-Reply-To: References: X-Sender: jan.kiszka@web.de X-Provags-ID: V01U2FsdGVkX18OfzZcswQxRgK22V9cZYTIMhHfhpIylS25vn92 QYArKvCby/c0jHGIOtCcE2fKStFu/X6V4rYVfzXZxD930A4owF fQNG8H2UE= Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Fri, 03 Dec 2010 23:38:27 +0000 (UTC) diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c index 5f92acc..6341765 100644 --- a/kernel/irq/manage.c +++ b/kernel/irq/manage.c @@ -879,17 +879,14 @@ EXPORT_SYMBOL_GPL(setup_irq); * Internal function to unregister an irqaction - used to free * regular and special interrupts that are part of the architecture. */ -static struct irqaction *__free_irq(unsigned int irq, void *dev_id) +static struct irqaction *__free_irq(struct irq_desc *desc, void *dev_id) { - struct irq_desc *desc = irq_to_desc(irq); struct irqaction *action, **action_ptr; + unsigned int irq = desc->irq_data.irq; unsigned long flags; WARN(in_interrupt(), "Trying to free IRQ %d from IRQ context!\n", irq); - if (!desc) - return NULL; - raw_spin_lock_irqsave(&desc->lock, flags); /* @@ -977,7 +974,12 @@ static struct irqaction *__free_irq(unsigned int irq, void *dev_id) */ void remove_irq(unsigned int irq, struct irqaction *act) { - __free_irq(irq, act->dev_id); + struct irq_desc *desc = irq_to_desc(irq); + + if (!desc) + return; + + __free_irq(desc, act->dev_id); } EXPORT_SYMBOL_GPL(remove_irq); @@ -1003,7 +1005,7 @@ void free_irq(unsigned int irq, void *dev_id) return; chip_bus_lock(desc); - kfree(__free_irq(irq, dev_id)); + kfree(__free_irq(desc, dev_id)); chip_bus_sync_unlock(desc); } EXPORT_SYMBOL(free_irq);