[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] Re: [PATCH 1/2] qemu/qdev: type safety in reset handler

From: Gerd Hoffmann
Subject: [Qemu-devel] Re: [PATCH 1/2] qemu/qdev: type safety in reset handler
Date: Wed, 16 Sep 2009 12:13:31 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv: Gecko/20090814 Fedora/3.0-2.6.b3.fc11 Lightning/1.0pre Thunderbird/3.0b3

On 09/15/09 23:37, Michael S. Tsirkin wrote:
On Tue, Sep 15, 2009 at 11:16:42PM +0200, Paolo Bonzini wrote:

He means not introducing pci_rtl8139_reset.


Several places in this file use the variant that gets RTL8139State,
to me it seems nicer to have that in a single place.

How about creating a helper macro to go from ${device}State to DeviceState, then kill the wrapper function? i.e something like this:

#define TO_QDEV_STATE(state) (&((state)->dev.qdev))

Then have one reset function which accepts DeviceState. The call sites which have RTL8139State at hand can use rtl8139_reset(TO_QDEV_STATE(s));


reply via email to

[Prev in Thread] Current Thread [Next in Thread]