lkml.org 
[lkml]   [2009]   [May]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 5/7] x86/pci: add 4 more return param in IO_APIC_get_PCI_irq_vector

* Yinghai Lu <yinghai@kernel.org> wrote:

> +int IO_APIC_get_PCI_irq_vector(int bus, int slot, int pin,
> + int *ioapic, int *ioapic_pin,
> + int *trigger, int *polarity)

> if (io_apic_assign_pci_irqs) {
> int irq;
> + int ioapic = -1, ioapic_pin = -1;
> + int triggering, polarity;

please put this into a helper function/inline.

>
> - irq = IO_APIC_get_PCI_irq_vector(dev->bus->number, PCI_SLOT(dev->devfn), pin - 1);
> + irq = IO_APIC_get_PCI_irq_vector(dev->bus->number,
> + PCI_SLOT(dev->devfn),
> + pin - 1,
> + &ioapic, &ioapic_pin,
> + &triggering, &polarity);
> /*
> * Busses behind bridges are typically not listed in the MP-table.
> * In this case we have to look up the IRQ based on the parent bus,
> @@ -1235,7 +1248,10 @@ static int pirq_enable_irq(struct pci_de
>
> pin = pci_swizzle_interrupt_pin(dev, pin);
> irq = IO_APIC_get_PCI_irq_vector(bridge->bus->number,
> - PCI_SLOT(bridge->devfn), pin - 1);
> + PCI_SLOT(bridge->devfn),
> + pin - 1,
> + &ioapic, &ioapic_pin,
> + &triggering, &polarity);
> if (irq >= 0)
> dev_warn(&dev->dev, "using bridge %s "
> "INT %c to get IRQ %d\n",

That function has way too many parameters. Please introduce a helper
structure (struct io_apic_irq_attr) where the parameters can be
passed along in a clean and short fashion. We update them by
reference anyway.

I've applied the patch, but we need these cleanups too, the code has
become too ugly.

Ingo


\
 
 \ /
  Last update: 2009-05-11 10:33    [W:0.155 / U:0.112 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site