From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:44435) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UK6VD-0005Px-4p for qemu-devel@nongnu.org; Mon, 25 Mar 2013 08:27:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UK6VA-0004kK-Ba for qemu-devel@nongnu.org; Mon, 25 Mar 2013 08:27:51 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51522) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UK6VA-0004kF-52 for qemu-devel@nongnu.org; Mon, 25 Mar 2013 08:27:48 -0400 Date: Mon, 25 Mar 2013 14:28:22 +0200 From: "Michael S. Tsirkin" Message-ID: <20130325122822.GA12202@redhat.com> References: <1364124760-5794-1-git-send-email-peter.maydell@linaro.org> <1364124760-5794-8-git-send-email-peter.maydell@linaro.org> <20130325121249.GA11918@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [PATCH 07/10] versatile_pci: Implement the correct PCI IRQ mapping List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: Arnd Bergmann , patches@linaro.org, Will Deacon , qemu-devel@nongnu.org, Paul Brook , Andreas =?iso-8859-1?Q?F=E4rber?= On Mon, Mar 25, 2013 at 12:17:39PM +0000, Peter Maydell wrote: > On 25 March 2013 12:12, Michael S. Tsirkin wrote: > > On Sun, Mar 24, 2013 at 11:32:37AM +0000, Peter Maydell wrote: > >> + return (PCI_SLOT(d->devfn) + irq_num - 2) % PCI_NUM_PINS; > > > > It seems this can be a bit shorter: > > pci_swizzle_map_irq_fn(d, irq_num - 2) > > and below irq_num - 1 ? > > Yes (though does pci_swizzle_map_irq_fn() accept negative > pin values deliberately or by fluke? it might be better to > use irq_num + 2 / + 3 , maybe.) > > -- PMM Yes, I prefer + too. The use of - here gave me pause though I figured out it's all right in the end.