qemu-trivial
[Top][All Lists]
Advanced

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

Re: [Qemu-trivial] [PATCHv2] dma/i82374: avoid double creation of i82374


From: Paolo Bonzini
Subject: Re: [Qemu-trivial] [PATCHv2] dma/i82374: avoid double creation of i82374 device
Date: Mon, 2 Oct 2017 14:50:07 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0

On 29/09/2017 21:31, Eduardo Habkost wrote:
>> -void DMA_init(ISABus *bus, int high_page_enable)
>> +void DMA_init(ISABus *bus, int high_page_enable, Error **errp)
> 
> If you make the function return a boolean to indicate success (in
> addition to setting *errp), you avoid the need for a local_err
> variable on the caller.

I think in this case, rather than a bool, it would be better to return 0
or -EBUSY.  A check for "< 0" would be more self-explanatory in the caller.

Paolo



reply via email to

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