[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-trivial] [PATCHv2] dma/i82374: avoid double creation of i82374
From: |
Eduardo Habkost |
Subject: |
Re: [Qemu-trivial] [PATCHv2] dma/i82374: avoid double creation of i82374 device |
Date: |
Tue, 3 Oct 2017 10:37:05 -0300 |
User-agent: |
Mutt/1.8.3 (2017-05-23) |
On Mon, Oct 02, 2017 at 02:50:07PM +0200, Paolo Bonzini wrote:
> 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.
I'm OK with that, too.
We really need to document the available and preferred error
reporting styles somewhere (probably on qapi/error.h). We
discussed that a lot recently[1], but the conclusions were not
documented anywhere.
[1] https://www.mail-archive.com/address@hidden/msg461702.html
--
Eduardo