From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: qemu-devel@nongnu.org, qemu-trivial@nongnu.org
Cc: "Fam Zheng" <fam@euphon.net>,
"Peter Maydell" <peter.maydell@linaro.org>,
"Dmitry Fleytman" <dmitry.fleytman@gmail.com>,
"Aleksandar Markovic" <amarkovic@wavecomp.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
"Aleksandar Rikalo" <arikalo@wavecomp.com>,
"Markus Armbruster" <armbru@redhat.com>,
"David Hildenbrand" <david@redhat.com>,
"Alex Williamson" <alex.williamson@redhat.com>,
qemu-s390x@nongnu.org, "Halil Pasic" <pasic@linux.ibm.com>,
"Christian Borntraeger" <borntraeger@de.ibm.com>,
"Michael Walle" <michael@walle.cc>,
"Gerd Hoffmann" <kraxel@redhat.com>,
"Cornelia Huck" <cohuck@redhat.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Philippe Mathieu-Daudé" <philmd@redhat.com>,
"Richard Henderson" <rth@twiddle.net>
Subject: [Qemu-devel] [PATCH v2 02/10] hw/scsi: Use the QOM BUS() macro to access BusState.qbus
Date: Tue, 28 May 2019 18:40:12 +0200 [thread overview]
Message-ID: <20190528164020.32250-3-philmd@redhat.com> (raw)
In-Reply-To: <20190528164020.32250-1-philmd@redhat.com>
Rather than looking inside the definition of a BusState with "s->bus.qbus",
use the QOM prefered style: "BUS(&s->bus)".
This patch was generated using the following Coccinelle script:
// Use BUS() macros to access BusState.qbus
@use_bus_macro_to_access_qbus@
expression obj;
identifier bus;
@@
-&obj->bus.qbus
+BUS(&obj->bus)
Suggested-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
hw/scsi/lsi53c895a.c | 2 +-
hw/scsi/mptsas.c | 4 ++--
hw/scsi/virtio-scsi.c | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/hw/scsi/lsi53c895a.c b/hw/scsi/lsi53c895a.c
index da7239d94f..a8b7a199f9 100644
--- a/hw/scsi/lsi53c895a.c
+++ b/hw/scsi/lsi53c895a.c
@@ -1860,7 +1860,7 @@ static void lsi_reg_writeb(LSIState *s, int offset, uint8_t val)
}
if (val & LSI_SCNTL1_RST) {
if (!(s->sstat0 & LSI_SSTAT0_RST)) {
- qbus_reset_all(&s->bus.qbus);
+ qbus_reset_all(BUS(&s->bus));
s->sstat0 |= LSI_SSTAT0_RST;
lsi_script_scsi_interrupt(s, LSI_SIST0_RST, 0);
}
diff --git a/hw/scsi/mptsas.c b/hw/scsi/mptsas.c
index 929404fb48..e800683e91 100644
--- a/hw/scsi/mptsas.c
+++ b/hw/scsi/mptsas.c
@@ -540,7 +540,7 @@ reply_maybe_async:
break;
case MPI_SCSITASKMGMT_TASKTYPE_RESET_BUS:
- qbus_reset_all(&s->bus.qbus);
+ qbus_reset_all(BUS(&s->bus));
break;
default:
@@ -803,7 +803,7 @@ static void mptsas_soft_reset(MPTSASState *s)
s->intr_mask = MPI_HIM_DIM | MPI_HIM_RIM;
mptsas_update_interrupt(s);
- qbus_reset_all(&s->bus.qbus);
+ qbus_reset_all(BUS(&s->bus));
s->intr_status = 0;
s->intr_mask = save_mask;
diff --git a/hw/scsi/virtio-scsi.c b/hw/scsi/virtio-scsi.c
index 839f120256..2a71b78e22 100644
--- a/hw/scsi/virtio-scsi.c
+++ b/hw/scsi/virtio-scsi.c
@@ -696,7 +696,7 @@ static void virtio_scsi_reset(VirtIODevice *vdev)
assert(!s->dataplane_started);
s->resetting++;
- qbus_reset_all(&s->bus.qbus);
+ qbus_reset_all(BUS(&s->bus));
s->resetting--;
vs->sense_size = VIRTIO_SCSI_SENSE_DEFAULT_SIZE;
--
2.20.1
next prev parent reply other threads:[~2019-05-28 16:47 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-28 16:40 [Qemu-devel] [PATCH v2 00/10] qom: Use BUS()/DEVICE() macros instead of looking inside definitions Philippe Mathieu-Daudé
2019-05-28 16:40 ` [Qemu-devel] [PATCH v2 01/10] hw/scsi/vmw_pvscsi: Use qbus_reset_all() directly Philippe Mathieu-Daudé
2019-06-02 7:02 ` Dmitry Fleytman
2019-06-06 9:29 ` [Qemu-devel] [Qemu-trivial] " Laurent Vivier
2019-05-28 16:40 ` Philippe Mathieu-Daudé [this message]
2019-06-06 9:41 ` [Qemu-devel] [Qemu-trivial] [PATCH v2 02/10] hw/scsi: Use the QOM BUS() macro to access BusState.qbus Laurent Vivier
2019-06-06 9:54 ` Laurent Vivier
2019-05-28 16:40 ` [Qemu-devel] [PATCH v2 03/10] hw/pci-bridge: " Philippe Mathieu-Daudé
2019-05-28 16:52 ` Marcel Apfelbaum
2019-06-06 9:31 ` [Qemu-devel] [Qemu-trivial] " Laurent Vivier
2019-05-28 16:40 ` [Qemu-devel] [PATCH v2 04/10] hw/s390x/event-facility: " Philippe Mathieu-Daudé
2019-05-28 17:00 ` Cornelia Huck
2019-06-06 9:32 ` [Qemu-devel] [Qemu-trivial] " Laurent Vivier
2019-05-28 16:40 ` [Qemu-devel] [PATCH v2 05/10] hw/sd: " Philippe Mathieu-Daudé
2019-05-28 16:47 ` Peter Maydell
2019-06-06 9:38 ` [Qemu-devel] [Qemu-trivial] " Laurent Vivier
2019-05-28 16:40 ` [Qemu-devel] [PATCH v2 06/10] hw/audio/ac97: Use the QOM DEVICE() macro to access DeviceState.qdev Philippe Mathieu-Daudé
2019-05-28 16:46 ` Peter Maydell
2019-06-06 9:36 ` [Qemu-devel] [Qemu-trivial] " Laurent Vivier
2019-05-28 16:40 ` [Qemu-devel] [PATCH v2 07/10] hw/isa: " Philippe Mathieu-Daudé
2019-05-28 16:53 ` Marcel Apfelbaum
2019-06-06 9:33 ` [Qemu-devel] [Qemu-trivial] " Laurent Vivier
2019-05-28 16:40 ` [Qemu-devel] [PATCH v2 08/10] hw/usb-storage: " Philippe Mathieu-Daudé
2019-05-29 5:02 ` Gerd Hoffmann
2019-06-06 9:34 ` [Qemu-devel] [Qemu-trivial] " Laurent Vivier
2019-05-28 16:40 ` [Qemu-devel] [PATCH v2 09/10] hw/vfio/pci: " Philippe Mathieu-Daudé
2019-06-03 18:56 ` Alex Williamson
2019-06-06 9:39 ` [Qemu-devel] [Qemu-trivial] " Laurent Vivier
2019-05-28 16:40 ` [Qemu-devel] [PATCH v2 10/10] hw/watchdog/wdt_i6300esb: Use " Philippe Mathieu-Daudé
2019-06-06 9:42 ` [Qemu-devel] [Qemu-trivial] " Laurent Vivier
2019-06-06 9:55 ` Laurent Vivier
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=20190528164020.32250-3-philmd@redhat.com \
--to=philmd@redhat.com \
--cc=alex.williamson@redhat.com \
--cc=amarkovic@wavecomp.com \
--cc=arikalo@wavecomp.com \
--cc=armbru@redhat.com \
--cc=borntraeger@de.ibm.com \
--cc=cohuck@redhat.com \
--cc=david@redhat.com \
--cc=dmitry.fleytman@gmail.com \
--cc=fam@euphon.net \
--cc=kraxel@redhat.com \
--cc=michael@walle.cc \
--cc=mst@redhat.com \
--cc=pasic@linux.ibm.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-s390x@nongnu.org \
--cc=qemu-trivial@nongnu.org \
--cc=rth@twiddle.net \
/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).