From: "wangyanan (Y)" <wangyanan55@huawei.com>
To: "Philippe Mathieu-Daudé" <f4bug@amsat.org>, qemu-devel@nongnu.org
Cc: qemu-trivial@nongnu.org, Peter Maydell <peter.maydell@linaro.org>,
Richard Henderson <richard.henderson@linaro.org>,
Eduardo Habkost <ehabkost@redhat.com>
Subject: Re: [PATCH 2/3] hw/qdev: Rename qdev_connect_gpio_out*() 'input_pin' parameter
Date: Sat, 6 Nov 2021 11:21:08 +0800 [thread overview]
Message-ID: <6fc3573e-ebe8-cb23-3105-6972dbdf7203@huawei.com> (raw)
In-Reply-To: <20211105172127.224462-3-f4bug@amsat.org>
On 2021/11/6 1:21, Philippe Mathieu-Daudé wrote:
> @pin is an input where we connect a device output.
> Rename it @input_pin to simplify the documentation.
>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
> include/hw/qdev-core.h | 8 ++++----
> hw/core/gpio.c | 13 +++++++------
> 2 files changed, 11 insertions(+), 10 deletions(-)
>
> diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h
> index 5b88c8b9dd3..3a0fe643a73 100644
> --- a/include/hw/qdev-core.h
> +++ b/include/hw/qdev-core.h
> @@ -470,7 +470,7 @@ qemu_irq qdev_get_gpio_in_named(DeviceState *dev, const char *name, int n);
> * qdev_connect_gpio_out: Connect one of a device's anonymous output GPIO lines
> * @dev: Device whose GPIO to connect
> * @n: Number of the anonymous output GPIO line (which must be in range)
> - * @pin: qemu_irq to connect the output line to
> + * @input_pin: qemu_irq to connect the output line to
> *
> * This function connects an anonymous output GPIO line on a device
> * up to an arbitrary qemu_irq, so that when the device asserts that
> @@ -495,14 +495,14 @@ qemu_irq qdev_get_gpio_in_named(DeviceState *dev, const char *name, int n);
> *
> * For named output GPIO lines, use qdev_connect_gpio_out_named().
> */
> -void qdev_connect_gpio_out(DeviceState *dev, int n, qemu_irq pin);
> +void qdev_connect_gpio_out(DeviceState *dev, int n, qemu_irq input_pin);
> /**
> * qdev_connect_gpio_out_named: Connect one of a device's named output
> * GPIO lines
> * @dev: Device whose GPIO to connect
> * @name: Name of the output GPIO array
> * @n: Number of the anonymous output GPIO line (which must be in range)
> - * @pin: qemu_irq to connect the output line to
> + * @input_pin: qemu_irq to connect the output line to
> *
> * This function connects an anonymous output GPIO line on a device
> * up to an arbitrary qemu_irq, so that when the device asserts that
> @@ -521,7 +521,7 @@ void qdev_connect_gpio_out(DeviceState *dev, int n, qemu_irq pin);
> * same qemu_irq; see qdev_connect_gpio_out() for details.
> */
> void qdev_connect_gpio_out_named(DeviceState *dev, const char *name, int n,
> - qemu_irq pin);
> + qemu_irq input_pin);
> /**
> * qdev_get_gpio_out_connector: Get the qemu_irq connected to an output GPIO
> * @dev: Device whose output GPIO we are interested in
> diff --git a/hw/core/gpio.c b/hw/core/gpio.c
> index 8e6b4f5edf3..80d07a6ec99 100644
> --- a/hw/core/gpio.c
> +++ b/hw/core/gpio.c
> @@ -115,17 +115,18 @@ qemu_irq qdev_get_gpio_in(DeviceState *dev, int n)
> }
>
> void qdev_connect_gpio_out_named(DeviceState *dev, const char *name, int n,
> - qemu_irq pin)
> + qemu_irq input_pin)
> {
> char *propname = g_strdup_printf("%s[%d]",
> name ? name : "unnamed-gpio-out", n);
> - if (pin && !OBJECT(pin)->parent) {
> + if (input_pin && !OBJECT(input_pin)->parent) {
> /* We need a name for object_property_set_link to work */
> object_property_add_child(container_get(qdev_get_machine(),
> "/unattached"),
> - "non-qdev-gpio[*]", OBJECT(pin));
> + "non-qdev-gpio[*]", OBJECT(input_pin));
> }
> - object_property_set_link(OBJECT(dev), propname, OBJECT(pin), &error_abort);
> + object_property_set_link(OBJECT(dev), propname,
> + OBJECT(input_pin), &error_abort);
> g_free(propname);
> }
>
> @@ -165,9 +166,9 @@ qemu_irq qdev_intercept_gpio_out(DeviceState *dev, qemu_irq icpt,
> return disconnected;
> }
>
> -void qdev_connect_gpio_out(DeviceState *dev, int n, qemu_irq pin)
> +void qdev_connect_gpio_out(DeviceState *dev, int n, qemu_irq input_pin)
> {
> - qdev_connect_gpio_out_named(dev, NULL, n, pin);
> + qdev_connect_gpio_out_named(dev, NULL, n, input_pin);
> }
>
> void qdev_pass_gpios(DeviceState *dev, DeviceState *container,
Reviewed-by: Yanan Wang <wangyanan55@huawei.com>
Thanks,
Yanan
next prev parent reply other threads:[~2021-11-06 3:23 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-05 17:21 [PATCH 0/3] hw/qdev: Clarify qdev_connect_gpio_out() documentation Philippe Mathieu-Daudé
2021-11-05 17:21 ` [PATCH 1/3] hw/qdev: Correct qdev_connect_gpio_out_named() documentation Philippe Mathieu-Daudé
2021-11-06 3:06 ` wangyanan (Y)
2021-11-05 17:21 ` [PATCH 2/3] hw/qdev: Rename qdev_connect_gpio_out*() 'input_pin' parameter Philippe Mathieu-Daudé
2021-11-06 3:21 ` wangyanan (Y) [this message]
2021-11-05 17:21 ` [PATCH 3/3] hw/input/pckbd: Rename i8042_setup_a20_line() and its a20 irq argument Philippe Mathieu-Daudé
2021-11-06 3:35 ` wangyanan (Y)
2021-11-22 11:14 ` Peter Maydell
2021-12-17 23:50 ` Philippe Mathieu-Daudé
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=6fc3573e-ebe8-cb23-3105-6972dbdf7203@huawei.com \
--to=wangyanan55@huawei.com \
--cc=ehabkost@redhat.com \
--cc=f4bug@amsat.org \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@nongnu.org \
--cc=richard.henderson@linaro.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).