qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
Cc: "QEMU Trivial" <qemu-trivial@nongnu.org>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Daniel P. Berrangé" <berrange@redhat.com>,
	"QEMU Developers" <qemu-devel@nongnu.org>,
	"Eduardo Habkost" <ehabkost@redhat.com>
Subject: Re: [PATCH 1/2] hw/core/qdev: Make qdev_pass_gpios() arguments self-describing
Date: Tue, 25 Aug 2020 16:00:24 +0100	[thread overview]
Message-ID: <CAFEAcA-HKWvLWJ8MPigAni8jHwg5qu6kEq1=TgXVMvo5oeTeLg@mail.gmail.com> (raw)
In-Reply-To: <20200818143825.691110-2-f4bug@amsat.org>

On Tue, 18 Aug 2020 at 15:38, Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:
>
> Make the direction qdev_pass_gpios() pass the GPIOs more obvious
> by renaming its arguments as 'from_dev' and 'to_container'.
>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  include/hw/qdev-core.h | 10 +++++-----
>  hw/core/qdev.c         | 14 +++++++-------
>  2 files changed, 12 insertions(+), 12 deletions(-)
>
> diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h
> index ea3f73a282d..c72d4db2d26 100644
> --- a/include/hw/qdev-core.h
> +++ b/include/hw/qdev-core.h
> @@ -643,8 +643,8 @@ static inline void qdev_init_gpio_in_named(DeviceState *dev,
>
>  /**
>   * qdev_pass_gpios: create GPIO lines on container which pass through to device

In the line above we say that the pass through is from the container
to the device...

> - * @dev: Device which has GPIO lines
> - * @container: Container device which needs to expose them
> + * @from_dev: Device which has GPIO lines
> + * @to_container: Container device which needs to expose them

...but here we say that it is from the device to the container.

You could make an argument for either convention of from/to,
but we should be consistent. The most useful part of the name
is the part we already have, because 'dev' vs 'container'
is unambiguous, whereas 'to' vs 'from' depends on your
point of view and doesn't really help in working out which
way round the arguments should go.

thanks
-- PMM


  reply	other threads:[~2020-08-25 15:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-18 14:38 [PATCH 0/2] hw/core: Make qdev_pass_gpios/sysbus_pass_irq arguments self-describing Philippe Mathieu-Daudé
2020-08-18 14:38 ` [PATCH 1/2] hw/core/qdev: Make qdev_pass_gpios() " Philippe Mathieu-Daudé
2020-08-25 15:00   ` Peter Maydell [this message]
2020-08-18 14:38 ` [PATCH 2/2] hw/core/sysbus: Make sysbus_pass_irq() " Philippe Mathieu-Daudé
2020-08-25 15:04   ` Peter Maydell

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='CAFEAcA-HKWvLWJ8MPigAni8jHwg5qu6kEq1=TgXVMvo5oeTeLg@mail.gmail.com' \
    --to=peter.maydell@linaro.org \
    --cc=berrange@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=f4bug@amsat.org \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).