lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 11 May 2009 10:28:34 +0200
From:	Ingo Molnar <mingo@...e.hu>
To:	Yinghai Lu <yinghai@...nel.org>
Cc:	Thomas Gleixner <tglx@...utronix.de>,
	"H. Peter Anvin" <hpa@...or.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Jesse Barnes <jbarnes@...tuousgeek.org>,
	Len Brown <lenb@...nel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	linux-pci@...r.kernel.org,
	ACPI Devel Maling List <linux-acpi@...r.kernel.org>
Subject: Re: [PATCH 5/7] x86/pci: add 4 more return param in
	IO_APIC_get_PCI_irq_vector


* Yinghai Lu <yinghai@...nel.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ