[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-ppc] [Qemu-devel] [PATCH 6/7] mac_dbdma: change DBDMA_register
From: |
David Gibson |
Subject: |
Re: [Qemu-ppc] [Qemu-devel] [PATCH 6/7] mac_dbdma: change DBDMA_register_channel to a MAC_DBDMA type method |
Date: |
Sat, 30 Sep 2017 13:23:12 +1000 |
User-agent: |
Mutt/1.9.0 (2017-09-02) |
On Thu, Sep 28, 2017 at 07:40:18AM +0100, Mark Cave-Ayland wrote:
> On 26/09/17 04:47, David Gibson wrote:
>
> > On Sun, Sep 24, 2017 at 03:47:45PM +0100, Mark Cave-Ayland wrote:
> >> Using this we can change the MACIO_IDE instance to register the channel
> >> itself via a type method instead of requiring a separate
> >> DBDMA_register_channel() function.
> >>
> >> As a consequence of this it is now possible to remove the old external
> >> macio_ide_register_dma() function.
> >>
> >> Signed-off-by: Mark Cave-Ayland <address@hidden>
> >
> > Ok, two concerns about this.
> >
> > First, you've added the function pointer to the instance, not to the
> > class, which is not how a QOM method would normally be done.
>
> Yeah I did think about whether I needed to create a full class but was
> torn since as you say there is only one implementation.
>
> > More generally, though, why is a method preferable to a plain
> > function? AFAICT it's not plausible that there will ever be more than
> > one implementation of the method.
> >
> > Same comments apply to patch 7/7.
>
> For me it's really for encapsulation. It seems a little odd requiring a
> global function to configure a QOM object to which I already have a
> reference.
Instead you're using the method which is defined in a global type
definition. I don't think it really makes any different to
encapsulation.
> If I were to redo the last 2 patches using a proper class, would you
> accept them?
>
>
> ATB,
>
> Mark.
>
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
signature.asc
Description: PGP signature
- [Qemu-ppc] [PATCH 0/7] mac_dbdma: tidy-up and QOMify, Mark Cave-Ayland, 2017/09/24
- [Qemu-ppc] [PATCH 3/7] mac_dbdma: remove DBDMA_init() function, Mark Cave-Ayland, 2017/09/24
- [Qemu-ppc] [PATCH 7/7] mac_dbdma: change DBDMA_kick to a MAC_DBDMA type method, Mark Cave-Ayland, 2017/09/24
- [Qemu-ppc] [PATCH 2/7] mac_dbdma: QOMify, Mark Cave-Ayland, 2017/09/24
- [Qemu-ppc] [PATCH 1/7] mac_dbdma: remove unused IO fields from DBDMAState, Mark Cave-Ayland, 2017/09/24
- [Qemu-ppc] [PATCH 5/7] macio: use object link between MACIO_IDE and MAC_DBDMA object, Mark Cave-Ayland, 2017/09/24
- [Qemu-ppc] [PATCH 4/7] macio: pass channel into MACIOIDEState via qdev property, Mark Cave-Ayland, 2017/09/24
- [Qemu-ppc] [PATCH 6/7] mac_dbdma: change DBDMA_register_channel to a MAC_DBDMA type method, Mark Cave-Ayland, 2017/09/24
- Re: [Qemu-ppc] [PATCH 0/7] mac_dbdma: tidy-up and QOMify, David Gibson, 2017/09/25