From: "Marc-André Lureau" <marcandre.lureau@gmail.com>
To: Osama Abdelkader <osama.abdelkader@gmail.com>
Cc: qemu-devel@nongnu.org, kraxel@redhat.com
Subject: Re: [PATCH] hw/audio: Remove dead code from ac97_realize
Date: Mon, 3 Nov 2025 10:07:06 +0400 [thread overview]
Message-ID: <CAJ+F1CJHP54C-mr1AXPS3H=tLiiG5AM-ExdRieAwNifhtrXKAA@mail.gmail.com> (raw)
In-Reply-To: <20251102231903.65409-1-osama.abdelkader@gmail.com>
On Mon, Nov 3, 2025 at 3:20 AM Osama Abdelkader
<osama.abdelkader@gmail.com> wrote:
>
> Remove unnecessary PCI configuration register initialization that was
> marked with TODO comments indicating it's redundant:
> - PCI_COMMAND register is already 0x00 by default, no need to override
> - PCI_BASE_ADDRESS_0 registers are automatically set by pci_register_bar()
>
> This aligns the code with the pattern used by other PCI audio devices
> in QEMU (via-ac97, intel-hda, es1370) and removes 15 lines of dead code.
>
> Signed-off-by: Osama Abdelkader <osama.abdelkader@gmail.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
> hw/audio/ac97.c | 19 -------------------
> 1 file changed, 19 deletions(-)
>
> diff --git a/hw/audio/ac97.c b/hw/audio/ac97.c
> index be7a39377f..60daa62ea3 100644
> --- a/hw/audio/ac97.c
> +++ b/hw/audio/ac97.c
> @@ -1279,30 +1279,11 @@ static void ac97_realize(PCIDevice *dev, Error **errp)
> return;
> }
>
> - /* TODO: no need to override */
> - c[PCI_COMMAND] = 0x00; /* pcicmd pci command rw, ro */
> - c[PCI_COMMAND + 1] = 0x00;
> -
> - /* TODO: */
> c[PCI_STATUS] = PCI_STATUS_FAST_BACK; /* pcists pci status rwc, ro */
> c[PCI_STATUS + 1] = PCI_STATUS_DEVSEL_MEDIUM >> 8;
>
> c[PCI_CLASS_PROG] = 0x00; /* pi programming interface ro */
>
> - /* TODO set when bar is registered. no need to override. */
> - /* nabmar native audio mixer base address rw */
> - c[PCI_BASE_ADDRESS_0] = PCI_BASE_ADDRESS_SPACE_IO;
> - c[PCI_BASE_ADDRESS_0 + 1] = 0x00;
> - c[PCI_BASE_ADDRESS_0 + 2] = 0x00;
> - c[PCI_BASE_ADDRESS_0 + 3] = 0x00;
> -
> - /* TODO set when bar is registered. no need to override. */
> - /* nabmbar native audio bus mastering base address rw */
> - c[PCI_BASE_ADDRESS_0 + 4] = PCI_BASE_ADDRESS_SPACE_IO;
> - c[PCI_BASE_ADDRESS_0 + 5] = 0x00;
> - c[PCI_BASE_ADDRESS_0 + 6] = 0x00;
> - c[PCI_BASE_ADDRESS_0 + 7] = 0x00;
> -
> c[PCI_INTERRUPT_LINE] = 0x00; /* intr_ln interrupt line rw */
> c[PCI_INTERRUPT_PIN] = 0x01; /* intr_pn interrupt pin ro */
>
> --
> 2.43.0
>
>
--
Marc-André Lureau
next prev parent reply other threads:[~2025-11-03 6:08 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-02 23:19 [PATCH] hw/audio: Remove dead code from ac97_realize Osama Abdelkader
2025-11-03 6:07 ` Marc-André Lureau [this message]
2025-11-04 17:19 ` 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='CAJ+F1CJHP54C-mr1AXPS3H=tLiiG5AM-ExdRieAwNifhtrXKAA@mail.gmail.com' \
--to=marcandre.lureau@gmail.com \
--cc=kraxel@redhat.com \
--cc=osama.abdelkader@gmail.com \
--cc=qemu-devel@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).