Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S261568AbTE1XEP (ORCPT ); Wed, 28 May 2003 19:04:15 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S261624AbTE1XEM (ORCPT ); Wed, 28 May 2003 19:04:12 -0400 Received: from modemcable204.207-203-24.mtl.mc.videotron.ca ([24.203.207.204]:55169 "EHLO montezuma.mastecende.com") by vger.kernel.org with ESMTP id S261568AbTE1XDB (ORCPT ); Wed, 28 May 2003 19:03:01 -0400 Date: Wed, 28 May 2003 19:06:01 -0400 (EDT) From: Zwane Mwaikambo X-X-Sender: zwane@montezuma.mastecende.com To: Jeff Garzik cc: "Nguyen, Tom L" , "Nakajima, Jun" , "" , "Saxena, Sunil" , "Mallick, Asit K" , "Carbonari, Steven" Subject: Re: RFC Proposal to enable MSI support in Linux kernel In-Reply-To: <3ED53FE3.8090503@pobox.com> Message-ID: References: <3ED53FE3.8090503@pobox.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1557 Lines: 56 On Wed, 28 May 2003, Jeff Garzik wrote: > > +#ifdef CONFIG_PCI_USE_VECTOR > > + for (i = 0; i < (NR_VECTORS - FIRST_EXTERNAL_VECTOR); i++) { > > +#else > > for (i = 0; i < NR_IRQS; i++) { > > +#endif > > This ifdef isn't necessary. ifdef in a header somewhere. For example, > make NR_IRQS (or some other constant, if changing NR_IRQS definition > isn't ok) condition on the CONFIG_xxx options. Actually we can simply use; for (i = 0; i < (NR_VECTORS - FIRST_EXTERNAL_VECTOR); i++) { vector = ... if (i >= NR_IRQS) break; ... set_intr_gate(vector, interrupt[i]); } > split into two functions, maybe? (due to the ifdef) Your call, it's > mainly a programmer preference. I agree. > A bigger question though: if platform_legacy_irq() returns zero, will > the handler _ever_ be edge-triggered? Good question, i wouldn't think so, that would collapse that section into two lines. > As I see more and more of these ifdefs, I wonder if they couldn't be > hidden inside wrappers? Yes some of them are a bit easy to botch up later on.. like the following excerpt. > > +#ifdef CONFIG_PCI_USE_VECTOR > > + if (!platform_legacy_irq(irq)) > > + entry->irq = IO_APIC_VECTOR(irq); > > + else > > +#endif > > entry->irq = irq; > > continue; Thanks, Zwane -- function.linuxpower.ca - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/