qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH V2 2/4] grlib-apbuart: Add support of various fl


From: Fabien Chouteau
Subject: Re: [Qemu-devel] [PATCH V2 2/4] grlib-apbuart: Add support of various flags
Date: Tue, 26 Feb 2013 10:59:03 +0100
User-agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130106 Thunderbird/17.0.2

On 02/23/2013 06:13 PM, Andreas Färber wrote:
> Am 19.02.2013 17:22, schrieb Fabien Chouteau:
>>
>> +static void grlib_apbuart_reset(DeviceState *d)
>> +{
>> +    UART *uart = container_of(d, UART, busdev.qdev);
>
> This is still wrong, please introduce a QOM cast macro for this device,
> e.g., GRLIB_APB_UART(d) due to the unfortunate use of UART rather than
> UARTState for the struct.

Hello,

Changing UART to UARTState is not difficult, but I don't understand why
the current name is a problem.

>
> http://wiki.qemu.org/QOMConventions
>

I didn't know this page. I think it would be great to have an example
for each point. Or maybe a complete "dummy" device that shows the best
practices.

> Also if you have some cycles, all SysBus init functions such as the one
> visible above should be replaced by instance_init and realize functions.
>

You mean dc->init instead of k->init?

-- 
Fabien Chouteau



reply via email to

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