aboutsummaryrefslogtreecommitdiff
path: root/hw/s390x/css.c
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2017-10-06 20:49:21 -0300
committerCornelia Huck <cohuck@redhat.com>2017-10-20 13:32:10 +0200
commit96f64aa8789451fc36396d848f397651fb999efb (patch)
tree294f1687d9b99c51d6147eb0dcff31a20ba899b9 /hw/s390x/css.c
parente67277f8f32d56c64c7993163f41bb4338aec566 (diff)
downloadqemu-96f64aa8789451fc36396d848f397651fb999efb.zip
qemu-96f64aa8789451fc36396d848f397651fb999efb.tar.gz
qemu-96f64aa8789451fc36396d848f397651fb999efb.tar.bz2
S390: use g_new() family of functions
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> [PMD: more changes in hw/s390x/css.c, added target/s390x/cpu_models.c] Message-Id: <20171006235023.11952-27-f4bug@amsat.org> Signed-off-by: Cornelia Huck <cohuck@redhat.com>
Diffstat (limited to 'hw/s390x/css.c')
-rw-r--r--hw/s390x/css.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/hw/s390x/css.c b/hw/s390x/css.c
index 35683d7..b6d4fca 100644
--- a/hw/s390x/css.c
+++ b/hw/s390x/css.c
@@ -488,7 +488,7 @@ int css_create_css_image(uint8_t cssid, bool default_image)
if (channel_subsys.css[cssid]) {
return -EBUSY;
}
- channel_subsys.css[cssid] = g_malloc0(sizeof(CssImage));
+ channel_subsys.css[cssid] = g_new0(CssImage, 1);
if (default_image) {
channel_subsys.default_cssid = cssid;
}
@@ -1778,7 +1778,7 @@ void css_undo_stcrw(CRW *crw)
{
CrwContainer *crw_cont;
- crw_cont = g_try_malloc0(sizeof(CrwContainer));
+ crw_cont = g_try_new0(CrwContainer, 1);
if (!crw_cont) {
channel_subsys.crws_lost = true;
return;
@@ -2185,7 +2185,7 @@ void css_subch_assign(uint8_t cssid, uint8_t ssid, uint16_t schid,
css = channel_subsys.css[cssid];
if (!css->sch_set[ssid]) {
- css->sch_set[ssid] = g_malloc0(sizeof(SubchSet));
+ css->sch_set[ssid] = g_new0(SubchSet, 1);
}
s_set = css->sch_set[ssid];
@@ -2206,7 +2206,7 @@ void css_queue_crw(uint8_t rsc, uint8_t erc, int solicited,
trace_css_crw(rsc, erc, rsid, chain ? "(chained)" : "");
/* TODO: Maybe use a static crw pool? */
- crw_cont = g_try_malloc0(sizeof(CrwContainer));
+ crw_cont = g_try_new0(CrwContainer, 1);
if (!crw_cont) {
channel_subsys.crws_lost = true;
return;
@@ -2498,7 +2498,7 @@ SubchDev *css_create_sch(CssDevId bus_id, bool is_virtual, bool squash_mcss,
}
}
- sch = g_malloc0(sizeof(*sch));
+ sch = g_new0(SubchDev, 1);
sch->cssid = bus_id.cssid;
sch->ssid = bus_id.ssid;
sch->devno = bus_id.devid;