From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MnflB-0007Yn-Hk for qemu-devel@nongnu.org; Tue, 15 Sep 2009 17:40:25 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mnfl7-0007VH-0k for qemu-devel@nongnu.org; Tue, 15 Sep 2009 17:40:25 -0400 Received: from [199.232.76.173] (port=49500 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mnfl6-0007V8-TS for qemu-devel@nongnu.org; Tue, 15 Sep 2009 17:40:20 -0400 Date: Wed, 16 Sep 2009 00:37:54 +0300 From: "Michael S. Tsirkin" Message-ID: <20090915213754.GD27954@redhat.com> References: <20090915143319.GB24708@redhat.com> <20090915204205.GB27954@redhat.com> <4AB0043A.3040507@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4AB0043A.3040507@gnu.org> Subject: [Qemu-devel] Re: [PATCH 1/2] qemu/qdev: type safety in reset handler List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Carsten Otte , markmc@redhat.com, Paul Brook , qemu-devel@nongnu.org, Blue Swirl , Christian Borntraeger , kraxel@redhat.com, Avi Kivity On Tue, Sep 15, 2009 at 11:16:42PM +0200, Paolo Bonzini wrote: > On 09/15/2009 10:42 PM, Michael S. Tsirkin wrote: >> On Tue, Sep 15, 2009 at 11:20:25PM +0300, Blue Swirl wrote: >>> On Tue, Sep 15, 2009 at 5:33 PM, Michael S. Tsirkin wrote: >>>> Add type safety to qdev reset handlers, by declaring them as >>>> DeviceState * rather than void *. >>> >>> The function seems a bit unnecessary, >> >> which function? >> >>> how about instead: >> >> instead of which one? >> >>> static void rtl8139_reset(struct DeviceState *d) >>> { >>> RTL8139State *s = container_of(d, RTL8139State, dev.qdev); > > He means not introducing pci_rtl8139_reset. > > Paolo Several places in this file use the variant that gets RTL8139State, to me it seems nicer to have that in a single place. -- MST