WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] Fix remove_pin_at_irq(), introduced with changeset

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Fix remove_pin_at_irq(), introduced with changeset
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Sat, 08 Apr 2006 12:44:07 +0000
Delivery-date: Sat, 08 Apr 2006 05:44:53 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID 70837ac15cadf83e1fda27ae8468317afeb88ab0
# Parent  12621916d8202c552ebf61127ef404354ed8ad0a
Fix remove_pin_at_irq(), introduced with changeset
9586:f84a333d8aa6e1a25e2b73b07610e95007267f6a.

Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>

diff -r 12621916d820 -r 70837ac15cad xen/arch/x86/io_apic.c
--- a/xen/arch/x86/io_apic.c    Sat Apr  8 08:05:53 2006
+++ b/xen/arch/x86/io_apic.c    Sat Apr  8 10:01:17 2006
@@ -110,7 +110,6 @@
 static void remove_pin_at_irq(unsigned int irq, int apic, int pin)
 {
     struct irq_pin_list *entry, *prev;
-    int idx;
 
     for (entry = &irq_2_pin[irq]; ; entry = &irq_2_pin[entry->next]) {
         if ((entry->apic == apic) && (entry->pin == pin))
@@ -119,18 +118,24 @@
             BUG();
     }
 
-    entry->pin  = -1;
-    entry->apic = -1;
+    entry->pin = entry->apic = -1;
     
-    idx = entry - irq_2_pin;
-    if (idx >= NR_IRQS) {
-        while (prev->next != idx)
+    if (entry != &irq_2_pin[irq]) {
+        /* Removed entry is not at head of list. */
+        prev = &irq_2_pin[irq];
+        while (&irq_2_pin[prev->next] != entry)
             prev = &irq_2_pin[prev->next];
         prev->next = entry->next;
         entry->next = irq_2_pin_free_entry;
-        irq_2_pin_free_entry = idx;
-    } else {
-        entry->next = 0;
+        irq_2_pin_free_entry = entry - irq_2_pin;
+    } else if (entry->next != 0) {
+        /* Removed entry is at head of multi-item list. */
+        prev  = entry;
+        entry = &irq_2_pin[entry->next];
+        *prev = *entry;
+        entry->pin = entry->apic = -1;
+        entry->next = irq_2_pin_free_entry;
+        irq_2_pin_free_entry = entry - irq_2_pin;
     }
 }
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Fix remove_pin_at_irq(), introduced with changeset, Xen patchbot -unstable <=