All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
To: David Gibson <david@gibson.dropbear.id.au>
Cc: qemu-ppc@nongnu.org, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 6/7] mac_dbdma: change DBDMA_register_channel to a MAC_DBDMA type method
Date: Thu, 28 Sep 2017 07:40:18 +0100	[thread overview]
Message-ID: <aaa2b280-4028-b593-e92a-5125d96fcbb6@ilande.co.uk> (raw)
In-Reply-To: <20170926034706.GG12504@umbus>

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 <mark.cave-ayland@ilande.co.uk>
> 
> 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.

If I were to redo the last 2 patches using a proper class, would you
accept them?


ATB,

Mark.

  reply	other threads:[~2017-09-28  6:40 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-24 14:47 [Qemu-devel] [PATCH 0/7] mac_dbdma: tidy-up and QOMify Mark Cave-Ayland
2017-09-24 14:47 ` [Qemu-devel] [PATCH 1/7] mac_dbdma: remove unused IO fields from DBDMAState Mark Cave-Ayland
2017-09-24 14:47 ` [Qemu-devel] [PATCH 2/7] mac_dbdma: QOMify Mark Cave-Ayland
2017-09-24 14:47 ` [Qemu-devel] [PATCH 3/7] mac_dbdma: remove DBDMA_init() function Mark Cave-Ayland
2017-09-24 14:47 ` [Qemu-devel] [PATCH 4/7] macio: pass channel into MACIOIDEState via qdev property Mark Cave-Ayland
2017-09-24 14:47 ` [Qemu-devel] [PATCH 5/7] macio: use object link between MACIO_IDE and MAC_DBDMA object Mark Cave-Ayland
2017-09-24 14:47 ` [Qemu-devel] [PATCH 6/7] mac_dbdma: change DBDMA_register_channel to a MAC_DBDMA type method Mark Cave-Ayland
2017-09-26  3:47   ` David Gibson
2017-09-28  6:40     ` Mark Cave-Ayland [this message]
2017-09-30  3:23       ` David Gibson
2017-09-24 14:47 ` [Qemu-devel] [PATCH 7/7] mac_dbdma: change DBDMA_kick " Mark Cave-Ayland
2017-09-25 23:49 ` [Qemu-devel] [PATCH 0/7] mac_dbdma: tidy-up and QOMify David Gibson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aaa2b280-4028-b593-e92a-5125d96fcbb6@ilande.co.uk \
    --to=mark.cave-ayland@ilande.co.uk \
    --cc=david@gibson.dropbear.id.au \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.