qemu-devel
[Top][All Lists]
Advanced

[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: Michael S. Tsirkin
Subject: [Qemu-devel] Re: [PATCH 1/2] qemu/qdev: type safety in reset handler
Date: Wed, 16 Sep 2009 13:14:03 +0300
User-agent: Mutt/1.5.19 (2009-01-05)

On Wed, Sep 16, 2009 at 12:13:31PM +0200, Gerd Hoffmann wrote:
> 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.
>>>
>>> Paolo
>>
>> 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));
>
> cheers,
>   Gerd

OK, since people feel strongly about it,
I killed the reset function.






reply via email to

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