From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=49522 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PGUIN-00074b-KZ for qemu-devel@nongnu.org; Thu, 11 Nov 2010 05:22:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PGUIM-0003cM-Hm for qemu-devel@nongnu.org; Thu, 11 Nov 2010 05:22:19 -0500 Received: from mx1.redhat.com ([209.132.183.28]:15653) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PGUIM-0003cD-9r for qemu-devel@nongnu.org; Thu, 11 Nov 2010 05:22:18 -0500 Date: Thu, 11 Nov 2010 12:22:15 +0200 From: Gleb Natapov Message-ID: <20101111102215.GX9036@redhat.com> References: <1289409261-5418-1-git-send-email-gleb@redhat.com> <1289409261-5418-4-git-send-email-gleb@redhat.com> <4CDBC212.602@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4CDBC212.602@redhat.com> Subject: [Qemu-devel] Re: [PATCHv3 03/14] Keep track of ISA ports ISA device is using in qdev. List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann Cc: kvm@vger.kernel.org, mst@redhat.com, qemu-devel@nongnu.org, armbru@redhat.com, blauwirbel@gmail.com, alex.williamson@redhat.com On Thu, Nov 11, 2010 at 11:14:42AM +0100, Gerd Hoffmann wrote: > Hi, > > > register_ioport_write (s->port, 1, 1, gus_writeb, s); > > register_ioport_write (s->port, 1, 2, gus_writew, s); > >+ isa_init_ioport_range(dev, s->port, 2); > > > > register_ioport_read ((s->port + 0x100)& 0xf00, 1, 1, gus_readb, s); > > register_ioport_read ((s->port + 0x100)& 0xf00, 1, 2, gus_readw, s); > >+ isa_init_ioport_range(dev, (s->port + 0x100)& 0xf00, 2); > > > > register_ioport_write (s->port + 6, 10, 1, gus_writeb, s); > > register_ioport_write (s->port + 6, 10, 2, gus_writew, s); > > register_ioport_read (s->port + 6, 10, 1, gus_readb, s); > > register_ioport_read (s->port + 6, 10, 2, gus_readw, s); > >+ isa_init_ioport_range(dev, s->port + 6, 10); > > > > > > register_ioport_write (s->port + 0x100, 8, 1, gus_writeb, s); > > register_ioport_write (s->port + 0x100, 8, 2, gus_writew, s); > > register_ioport_read (s->port + 0x100, 8, 1, gus_readb, s); > > register_ioport_read (s->port + 0x100, 8, 2, gus_readw, s); > >+ isa_init_ioport_range(dev, s->port + 0x100, 8); > > Seeing all the duplication here and elsewhere ... > > How about moving the register_ioport_{read,write} calls into > isa_init_ioport_range() ? > I am waiting for Avi's "Type-safe ioport callbacks" series to be applied before cleaning this up. With that patch what you propose will come naturally. -- Gleb.