All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Tokarev <mjt@tls.msk.ru>
To: qemu-devel@nongnu.org
Cc: "Philippe Mathieu-Daudé" <philmd@linaro.org>,
	qemu-trivial@nongnu.org,
	"Richard Henderson" <richard.henderson@linaro.org>,
	"Michael Tokarev" <mjt@tls.msk.ru>
Subject: [PULL 10/16] hw/pci/pci: Simplify pci_bar_address() using MACHINE_GET_CLASS() macro
Date: Sat, 10 Jun 2023 09:57:48 +0300	[thread overview]
Message-ID: <271233f21f66c10194a45c1bff1db61fe2694a22.1686379708.git.mjt@tls.msk.ru> (raw)
In-Reply-To: <cover.1686379708.git.mjt@tls.msk.ru>

From: Philippe Mathieu-Daudé <philmd@linaro.org>

Remove unnecessary intermediate variables.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 hw/pci/pci.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/hw/pci/pci.c b/hw/pci/pci.c
index 9b7b4d7c18..bf38905b7d 100644
--- a/hw/pci/pci.c
+++ b/hw/pci/pci.c
@@ -1446,9 +1446,7 @@ pcibus_t pci_bar_address(PCIDevice *d,
 {
     pcibus_t new_addr, last_addr;
     uint16_t cmd = pci_get_word(d->config + PCI_COMMAND);
-    Object *machine = qdev_get_machine();
-    ObjectClass *oc = object_get_class(machine);
-    MachineClass *mc = MACHINE_CLASS(oc);
+    MachineClass *mc = MACHINE_GET_CLASS(qdev_get_machine());
     bool allow_0_address = mc->pci_allow_0_address;
 
     if (type & PCI_BASE_ADDRESS_SPACE_IO) {
-- 
2.39.2



  parent reply	other threads:[~2023-06-10  6:59 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-10  6:57 [PULL 00/16] trivial patches 2023-06-10 Michael Tokarev
2023-06-10  6:57 ` [PULL 01/16] docs: Fix trivial typos in vhost-user.rst Michael Tokarev
2023-06-10  6:57 ` [PULL 02/16] hw/virtio/virtio-qmp.c: spelling: suppoted Michael Tokarev
2023-06-10  6:57 ` [PULL 03/16] spelling: information Michael Tokarev
2023-06-10  6:57 ` [PULL 04/16] hw/remote: Fix vfu_cfg trace offset format Michael Tokarev
2023-06-10  6:57 ` [PULL 05/16] block.c: add newline for "Detected format" warning Michael Tokarev
2023-06-10  6:57 ` [PULL 06/16] meson: install keyboard maps only if necessary Michael Tokarev
2023-06-10  6:57 ` [PULL 07/16] target/m68k/fpu_helper: Use FloatRelation enum to hold comparison result Michael Tokarev
2023-06-10  6:57 ` [PULL 08/16] hw/core/cpu: Simplify realize() using MACHINE_GET_CLASS() macro Michael Tokarev
2023-06-10  6:57 ` [PULL 09/16] hw/i386/microvm: Simplify using object_dynamic_cast() Michael Tokarev
2023-06-10  6:57 ` Michael Tokarev [this message]
2023-06-10  6:57 ` [PULL 11/16] hw/usb/hcd-ehci-pci: Simplify using DEVICE_GET_CLASS() macro Michael Tokarev
2023-06-10  6:57 ` [PULL 12/16] linux-user: add comments for TARGET_NR_[gs]etgroups{, 32} Michael Tokarev
2023-06-10  6:57 ` [PULL 13/16] linux-user: Return EINVAL for getgroups() with negative gidsetsize Michael Tokarev
2023-06-10  6:57 ` [PULL 14/16] vnc: move assert in vnc_worker_thread_loop Michael Tokarev
2023-06-10  6:57 ` [PULL 15/16] linux-user: elfload: s/min_mmap_addr/mmap_min_addr/ Michael Tokarev
2023-06-10  6:57 ` [PULL 16/16] linux-user: elfload: Specify -R is an option for qemu-user binaries Michael Tokarev
2023-06-10 15:44 ` [PULL 00/16] trivial patches 2023-06-10 Richard Henderson

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=271233f21f66c10194a45c1bff1db61fe2694a22.1686379708.git.mjt@tls.msk.ru \
    --to=mjt@tls.msk.ru \
    --cc=philmd@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 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.