From a2c3c74c989395c3906432ee91e054609c1cdb83 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Fri, 23 Nov 2007 15:35:53 -0500 Subject: [PATCH] Import 2.4.0-test2pre12 --- arch/i386/kernel/pci-irq.c | 15 +++++++-------- drivers/block/elevator.c | 4 ++-- drivers/block/ll_rw_blk.c | 12 ++++-------- include/asm-i386/io_apic.h | 2 +- 4 files changed, 14 insertions(+), 19 deletions(-) diff --git a/arch/i386/kernel/pci-irq.c b/arch/i386/kernel/pci-irq.c index 56dd411b685a..933d6c3c9894 100644 --- a/arch/i386/kernel/pci-irq.c +++ b/arch/i386/kernel/pci-irq.c @@ -128,14 +128,13 @@ static void eisa_set_level_irq(unsigned int irq) static int pirq_ali_get(struct pci_dev *router, struct pci_dev *dev, int pirq) { static unsigned char irqmap[16] = { 0, 9, 3, 10, 4, 5, 7, 6, 1, 11, 0, 12, 0, 14, 0, 15 }; + u8 x; + unsigned reg; + pirq--; - if (pirq < 8) { - u8 x; - unsigned reg = 0x48 + (pirq >> 1); - pci_read_config_byte(router, reg, &x); - return irqmap[(pirq & 1) ? (x >> 4) : (x & 0x0f)]; - } - return 0; + reg = 0x48 + (pirq >> 1); + pci_read_config_byte(router, reg, &x); + return irqmap[(pirq & 1) ? (x >> 4) : (x & 0x0f)]; } static int pirq_ali_set(struct pci_dev *router, struct pci_dev *dev, int pirq, int irq) @@ -143,7 +142,7 @@ static int pirq_ali_set(struct pci_dev *router, struct pci_dev *dev, int pirq, i static unsigned char irqmap[16] = { 0, 8, 0, 2, 4, 5, 7, 6, 0, 1, 3, 9, 11, 0, 13, 15 }; unsigned int val = irqmap[irq]; pirq--; - if (val && pirq < 8) { + if (val) { u8 x; unsigned reg = 0x48 + (pirq >> 1); pci_read_config_byte(router, reg, &x); diff --git a/drivers/block/elevator.c b/drivers/block/elevator.c index f004960a033a..2bf92251c850 100644 --- a/drivers/block/elevator.c +++ b/drivers/block/elevator.c @@ -83,10 +83,10 @@ int elevator_default_merge(request_queue_t *q, struct request **req, latency = orig_latency = elevator_request_latency(elevator, rw); sequence = elevator->sequence; + entry = head; if (q->head_active && !q->plugged) head = head->next; - entry = head; while ((entry = entry->prev) != head && !starving) { *req = blkdev_entry_to_request(entry); latency += (*req)->nr_segments; @@ -161,10 +161,10 @@ int elevator_linus_merge(request_queue_t *q, struct request **req, struct list_head *entry, *head = &q->queue_head; unsigned int count = bh->b_size >> 9; + entry = head; if (q->head_active && !q->plugged) head = head->next; - entry = head; while ((entry = entry->prev) != head) { *req = blkdev_entry_to_request(entry); if (!(*req)->elevator_sequence) diff --git a/drivers/block/ll_rw_blk.c b/drivers/block/ll_rw_blk.c index abe335a9b71f..2ed93b30079e 100644 --- a/drivers/block/ll_rw_blk.c +++ b/drivers/block/ll_rw_blk.c @@ -709,16 +709,12 @@ get_rq: req = __get_request_wait(q, rw); spin_lock_irq(&io_request_lock); - - /* - * revalidate elevator, queue request_lock was dropped - */ - head = &q->queue_head; - if (q->head_active && !q->plugged) - head = head->next; - } + head = &q->queue_head; + if (q->head_active && !q->plugged) + head = head->next; + /* fill up the request-info, and add it to the queue */ req->cmd = rw; req->errors = 0; diff --git a/include/asm-i386/io_apic.h b/include/asm-i386/io_apic.h index bb4038c15478..98358424439c 100644 --- a/include/asm-i386/io_apic.h +++ b/include/asm-i386/io_apic.h @@ -136,7 +136,7 @@ extern void IO_APIC_init_uniprocessor (void); * If we use the IO-APIC for IRQ routing, disable automatic * assignment of PCI IRQ's. */ -#define io_apic_assign_pci_irqs (!mp_irq_entries) +#define io_apic_assign_pci_irqs (mp_irq_entries != 0) #else /* !CONFIG_X86_IO_APIC */ #define io_apic_assign_pci_irqs 0 -- 2.39.5