All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] qdev: Complete qdev_init_gpio_out() documentation
@ 2021-08-19 14:27 Philippe Mathieu-Daudé
  2021-08-19 14:39 ` Peter Maydell
  2021-09-01 11:19 ` Markus Armbruster
  0 siblings, 2 replies; 4+ messages in thread
From: Philippe Mathieu-Daudé @ 2021-08-19 14:27 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Daniel P. Berrangé,
	Eduardo Habkost, Markus Armbruster, Paolo Bonzini,
	Philippe Mathieu-Daudé

qdev_init_gpio_out() states it "creates an array of anonymous
output GPIO lines" but doesn't document how this array is
released. Add a note that it is automatically free'd in qdev
instance_finalize().

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 include/hw/qdev-core.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h
index bafc311bfa1..555d4e444a5 100644
--- a/include/hw/qdev-core.h
+++ b/include/hw/qdev-core.h
@@ -597,6 +597,10 @@ void qdev_init_gpio_in(DeviceState *dev, qemu_irq_handler handler, int n);
  *
  * See qdev_connect_gpio_out() for how code that uses such a device
  * can connect to one of its output GPIO lines.
+ *
+ * There is no need to release the @pins allocated array because it
+ * will be automatically released when @dev calls its instance_finalize()
+ * handler.
  */
 void qdev_init_gpio_out(DeviceState *dev, qemu_irq *pins, int n);
 /**
-- 
2.31.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] qdev: Complete qdev_init_gpio_out() documentation
  2021-08-19 14:27 [PATCH] qdev: Complete qdev_init_gpio_out() documentation Philippe Mathieu-Daudé
@ 2021-08-19 14:39 ` Peter Maydell
  2021-09-01 11:19 ` Markus Armbruster
  1 sibling, 0 replies; 4+ messages in thread
From: Peter Maydell @ 2021-08-19 14:39 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Paolo Bonzini, Daniel P. Berrangé,
	QEMU Developers, Markus Armbruster, Eduardo Habkost

On Thu, 19 Aug 2021 at 15:27, Philippe Mathieu-Daudé <philmd@redhat.com> wrote:
>
> qdev_init_gpio_out() states it "creates an array of anonymous
> output GPIO lines" but doesn't document how this array is
> released. Add a note that it is automatically free'd in qdev
> instance_finalize().
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
>  include/hw/qdev-core.h | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h
> index bafc311bfa1..555d4e444a5 100644
> --- a/include/hw/qdev-core.h
> +++ b/include/hw/qdev-core.h
> @@ -597,6 +597,10 @@ void qdev_init_gpio_in(DeviceState *dev, qemu_irq_handler handler, int n);
>   *
>   * See qdev_connect_gpio_out() for how code that uses such a device
>   * can connect to one of its output GPIO lines.
> + *
> + * There is no need to release the @pins allocated array because it
> + * will be automatically released when @dev calls its instance_finalize()
> + * handler.
>   */
>  void qdev_init_gpio_out(DeviceState *dev, qemu_irq *pins, int n);
>  /**

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

thanks
-- PMM


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] qdev: Complete qdev_init_gpio_out() documentation
  2021-08-19 14:27 [PATCH] qdev: Complete qdev_init_gpio_out() documentation Philippe Mathieu-Daudé
  2021-08-19 14:39 ` Peter Maydell
@ 2021-09-01 11:19 ` Markus Armbruster
  2021-09-15 13:17   ` Laurent Vivier
  1 sibling, 1 reply; 4+ messages in thread
From: Markus Armbruster @ 2021-09-01 11:19 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Peter Maydell, Daniel P. Berrangé,
	Eduardo Habkost, qemu-trivial, qemu-devel, Paolo Bonzini

Cc: qemu-trivial

Philippe Mathieu-Daudé <philmd@redhat.com> writes:

> qdev_init_gpio_out() states it "creates an array of anonymous
> output GPIO lines" but doesn't document how this array is
> released. Add a note that it is automatically free'd in qdev
> instance_finalize().
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
>  include/hw/qdev-core.h | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h
> index bafc311bfa1..555d4e444a5 100644
> --- a/include/hw/qdev-core.h
> +++ b/include/hw/qdev-core.h
> @@ -597,6 +597,10 @@ void qdev_init_gpio_in(DeviceState *dev, qemu_irq_handler handler, int n);
>   *
>   * See qdev_connect_gpio_out() for how code that uses such a device
>   * can connect to one of its output GPIO lines.
> + *
> + * There is no need to release the @pins allocated array because it
> + * will be automatically released when @dev calls its instance_finalize()
> + * handler.
>   */
>  void qdev_init_gpio_out(DeviceState *dev, qemu_irq *pins, int n);
>  /**



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] qdev: Complete qdev_init_gpio_out() documentation
  2021-09-01 11:19 ` Markus Armbruster
@ 2021-09-15 13:17   ` Laurent Vivier
  0 siblings, 0 replies; 4+ messages in thread
From: Laurent Vivier @ 2021-09-15 13:17 UTC (permalink / raw)
  To: Markus Armbruster, Philippe Mathieu-Daudé
  Cc: Peter Maydell, Daniel P. Berrangé,
	Eduardo Habkost, qemu-trivial, qemu-devel, Paolo Bonzini

Le 01/09/2021 à 13:19, Markus Armbruster a écrit :
> Cc: qemu-trivial
> 
> Philippe Mathieu-Daudé <philmd@redhat.com> writes:
> 
>> qdev_init_gpio_out() states it "creates an array of anonymous
>> output GPIO lines" but doesn't document how this array is
>> released. Add a note that it is automatically free'd in qdev
>> instance_finalize().
>>
>> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
>> ---
>>  include/hw/qdev-core.h | 4 ++++
>>  1 file changed, 4 insertions(+)
>>
>> diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h
>> index bafc311bfa1..555d4e444a5 100644
>> --- a/include/hw/qdev-core.h
>> +++ b/include/hw/qdev-core.h
>> @@ -597,6 +597,10 @@ void qdev_init_gpio_in(DeviceState *dev, qemu_irq_handler handler, int n);
>>   *
>>   * See qdev_connect_gpio_out() for how code that uses such a device
>>   * can connect to one of its output GPIO lines.
>> + *
>> + * There is no need to release the @pins allocated array because it
>> + * will be automatically released when @dev calls its instance_finalize()
>> + * handler.
>>   */
>>  void qdev_init_gpio_out(DeviceState *dev, qemu_irq *pins, int n);
>>  /**
> 
> 

Applied to my trivial-patches branch.

Thanks,
Laurent


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-09-15 13:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-19 14:27 [PATCH] qdev: Complete qdev_init_gpio_out() documentation Philippe Mathieu-Daudé
2021-08-19 14:39 ` Peter Maydell
2021-09-01 11:19 ` Markus Armbruster
2021-09-15 13:17   ` Laurent Vivier

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.