From: Eduardo Habkost <ehabkost@redhat.com>
To: qemu-devel@nongnu.org
Cc: Cornelia Huck <cornelia.huck@de.ibm.com>,
Christian Borntraeger <borntraeger@de.ibm.com>,
Richard Henderson <rth@twiddle.net>,
Alexander Graf <agraf@suse.de>,
Marcel Apfelbaum <marcel.a@redhat.com>
Subject: [Qemu-devel] [PATCH 3/4] s390x/css: Use static initialization for channel_subsys fields
Date: Tue, 16 Feb 2016 18:59:06 -0200 [thread overview]
Message-ID: <1455656347-29033-4-git-send-email-ehabkost@redhat.com> (raw)
In-Reply-To: <1455656347-29033-1-git-send-email-ehabkost@redhat.com>
machine_init() will be gone, but we don't need it if we just
initialize the channel_subsys fields statically.
Cc: Cornelia Huck <cornelia.huck@de.ibm.com>
Cc: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Alexander Graf <agraf@suse.de>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
hw/s390x/css.c | 22 +++++++++-------------
1 file changed, 9 insertions(+), 13 deletions(-)
diff --git a/hw/s390x/css.c b/hw/s390x/css.c
index 2e9659a..15eb154 100644
--- a/hw/s390x/css.c
+++ b/hw/s390x/css.c
@@ -62,7 +62,15 @@ typedef struct ChannelSubSys {
QTAILQ_HEAD(, IoAdapter) io_adapters;
} ChannelSubSys;
-static ChannelSubSys channel_subsys;
+static ChannelSubSys channel_subsys = {
+ .pending_crws = QTAILQ_HEAD_INITIALIZER(channel_subsys.pending_crws),
+ .do_crw_mchk = true,
+ .sei_pending = false,
+ .do_crw_mchk = true,
+ .crws_lost = false,
+ .chnmon_active = false,
+ .io_adapters = QTAILQ_HEAD_INITIALIZER(channel_subsys.io_adapters),
+};
int css_create_css_image(uint8_t cssid, bool default_image)
{
@@ -1514,18 +1522,6 @@ int subch_device_load(SubchDev *s, QEMUFile *f)
return 0;
}
-
-static void css_init(void)
-{
- QTAILQ_INIT(&channel_subsys.pending_crws);
- channel_subsys.sei_pending = false;
- channel_subsys.do_crw_mchk = true;
- channel_subsys.crws_lost = false;
- channel_subsys.chnmon_active = false;
- QTAILQ_INIT(&channel_subsys.io_adapters);
-}
-machine_init(css_init);
-
void css_reset_sch(SubchDev *sch)
{
PMCW *p = &sch->curr_status.pmcw;
--
2.1.0
next prev parent reply other threads:[~2016-02-16 20:59 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-16 20:59 [Qemu-devel] [PATCH 0/4] machine: Eliminate machine_init()/MODULE_INIT_MACHINE Eduardo Habkost
2016-02-16 20:59 ` [Qemu-devel] [PATCH 1/4] machine: Use type_init() to register machine classes Eduardo Habkost
2016-02-17 15:32 ` Marcel Apfelbaum
2016-02-17 15:57 ` Michael S. Tsirkin
2016-02-18 2:35 ` David Gibson
2016-02-16 20:59 ` [Qemu-devel] [PATCH 2/4] s390x/css: Allocate channel_subsys statically Eduardo Habkost
2016-02-17 11:43 ` Cornelia Huck
2016-02-17 21:03 ` Eduardo Habkost
2016-02-23 11:12 ` Cornelia Huck
2016-02-16 20:59 ` Eduardo Habkost [this message]
2016-02-17 11:44 ` [Qemu-devel] [PATCH 3/4] s390x/css: Use static initialization for channel_subsys fields Cornelia Huck
2016-02-16 20:59 ` [Qemu-devel] [PATCH 4/4] module: Rename machine_init() to opts_init() Eduardo Habkost
2016-02-17 15:36 ` Marcel Apfelbaum
2016-02-17 15:58 ` Michael S. Tsirkin
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=1455656347-29033-4-git-send-email-ehabkost@redhat.com \
--to=ehabkost@redhat.com \
--cc=agraf@suse.de \
--cc=borntraeger@de.ibm.com \
--cc=cornelia.huck@de.ibm.com \
--cc=marcel.a@redhat.com \
--cc=qemu-devel@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).