All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: Bernhard Beschow <shentey@gmail.com>
Cc: "Philippe Mathieu-Daudé" <philmd@linaro.org>,
	qemu-devel@nongnu.org, qemu-ppc@nongnu.org,
	"Eduardo Habkost" <eduardo@habkost.net>,
	"Gerd Hoffmann" <kraxel@redhat.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	"Hervé Poussineau" <hpoussin@reactos.org>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Richard Henderson" <richard.henderson@linaro.org>,
	"Aleksandar Rikalo" <aleksandar.rikalo@syrmia.com>,
	"Marcel Apfelbaum" <marcel.apfelbaum@gmail.com>,
	"Mark Cave-Ayland" <mark.cave-ayland@ilande.co.uk>
Subject: Re: [PATCH v2] hw/audio/pcspk: Inline pcspk_init()
Date: Thu, 19 Oct 2023 19:54:04 +0200	[thread overview]
Message-ID: <87ttqmcxc3.fsf@pond.sub.org> (raw)
In-Reply-To: <C044C8A9-952A-4F9A-8B9F-DE689A5FEF46@gmail.com> (Bernhard Beschow's message of "Thu, 19 Oct 2023 10:23:14 +0000")

Bernhard Beschow <shentey@gmail.com> writes:

> Am 19. Oktober 2023 07:33:07 UTC schrieb "Philippe Mathieu-Daudé" <philmd@linaro.org>:
>>pcspk_init() is a legacy init function, inline and remove it.
>>
>>Since the device is realized using &error_fatal, use the same
>>error for setting the "pit" link.
>>
>>Reviewed-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
>>Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>

[...]

>>diff --git a/hw/isa/i82378.c b/hw/isa/i82378.c
>>index 63e0857208..79ffbb52a0 100644
>>--- a/hw/isa/i82378.c
>>+++ b/hw/isa/i82378.c
>>@@ -67,6 +67,7 @@ static void i82378_realize(PCIDevice *pci, Error **errp)
>>     uint8_t *pci_conf;
>>     ISABus *isabus;
>>     ISADevice *pit;
>>+    ISADevice *pcspk;
>> 
>>     pci_conf = pci->config;
>>     pci_set_word(pci_conf + PCI_COMMAND,
>>@@ -102,7 +103,9 @@ static void i82378_realize(PCIDevice *pci, Error **errp)
>>     pit = i8254_pit_init(isabus, 0x40, 0, NULL);
>> 
>>     /* speaker */
>>-    pcspk_init(isa_new(TYPE_PC_SPEAKER), isabus, pit);
>>+    pcspk = isa_new(TYPE_PC_SPEAKER);
>>+    object_property_set_link(OBJECT(pcspk), "pit", OBJECT(pit), &error_fatal);
>>+    isa_realize_and_unref(pcspk, isabus, &error_fatal);
>
> Why not pass errp here? I think that was Mark's comment in v1.

&error_fatal is almost always wrong in a function that takes Error **.
Happy to explain in more detail if needed.

[...]



  reply	other threads:[~2023-10-19 17:54 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-19  7:33 [PATCH v2] hw/audio/pcspk: Inline pcspk_init() Philippe Mathieu-Daudé
2023-10-19 10:23 ` Bernhard Beschow
2023-10-19 17:54   ` Markus Armbruster [this message]
2023-10-19 21:44     ` Philippe Mathieu-Daudé
2023-10-20  4:49       ` Markus Armbruster
2023-10-20 10:02         ` 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=87ttqmcxc3.fsf@pond.sub.org \
    --to=armbru@redhat.com \
    --cc=aleksandar.rikalo@syrmia.com \
    --cc=eduardo@habkost.net \
    --cc=hpoussin@reactos.org \
    --cc=kraxel@redhat.com \
    --cc=marcel.apfelbaum@gmail.com \
    --cc=mark.cave-ayland@ilande.co.uk \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=shentey@gmail.com \
    /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.