From: Cornelia Huck <cohuck@redhat.com>
To: peter.maydell@linaro.org
Cc: qemu-devel@nongnu.org, qemu-s390x@nongnu.org, rth@twiddle.net,
agraf@suse.de, thuth@redhat.com, borntraeger@de.ibm.com,
david@redhat.com,
"Marc-André Lureau" <marcandre.lureau@redhat.com>,
"Philippe Mathieu-Daudé" <f4bug@amsat.org>,
"Cornelia Huck" <cohuck@redhat.com>
Subject: [Qemu-devel] [PULL 01/46] S390: use g_new() family of functions
Date: Fri, 20 Oct 2017 13:53:33 +0200 [thread overview]
Message-ID: <20171020115418.2050-2-cohuck@redhat.com> (raw)
In-Reply-To: <20171020115418.2050-1-cohuck@redhat.com>
From: Marc-André Lureau <marcandre.lureau@redhat.com>
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>
---
hw/s390x/css.c | 10 +++++-----
hw/s390x/s390-pci-bus.c | 4 ++--
target/s390x/cpu_models.c | 12 ++++++------
target/s390x/diag.c | 2 +-
4 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/hw/s390x/css.c b/hw/s390x/css.c
index 35683d7954..b6d4fcaf06 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;
diff --git a/hw/s390x/s390-pci-bus.c b/hw/s390x/s390-pci-bus.c
index 96116b7d1e..e7a58e81f7 100644
--- a/hw/s390x/s390-pci-bus.c
+++ b/hw/s390x/s390-pci-bus.c
@@ -240,7 +240,7 @@ static void s390_pci_generate_event(uint8_t cc, uint16_t pec, uint32_t fh,
SeiContainer *sei_cont;
S390pciState *s = s390_get_phb();
- sei_cont = g_malloc0(sizeof(SeiContainer));
+ sei_cont = g_new0(SeiContainer, 1);
sei_cont->fh = fh;
sei_cont->fid = fid;
sei_cont->cc = cc;
@@ -416,7 +416,7 @@ static S390PCIIOMMU *s390_pci_get_iommu(S390pciState *s, PCIBus *bus,
S390PCIIOMMU *iommu;
if (!table) {
- table = g_malloc0(sizeof(S390PCIIOMMUTable));
+ table = g_new0(S390PCIIOMMUTable, 1);
table->key = key;
g_hash_table_insert(s->iommu_table, &table->key, table);
}
diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c
index 07ef8a3b6e..8c2d8851ae 100644
--- a/target/s390x/cpu_models.c
+++ b/target/s390x/cpu_models.c
@@ -392,7 +392,7 @@ static void create_cpu_model_list(ObjectClass *klass, void *opaque)
/* strip off the -s390-cpu */
g_strrstr(name, "-" TYPE_S390_CPU)[0] = 0;
- info = g_malloc0(sizeof(*info));
+ info = g_new0(CpuDefinitionInfo, 1);
info->name = name;
info->has_migration_safe = true;
info->migration_safe = scc->is_migration_safe;
@@ -412,7 +412,7 @@ static void create_cpu_model_list(ObjectClass *klass, void *opaque)
object_unref(obj);
}
- entry = g_malloc0(sizeof(*entry));
+ entry = g_new0(CpuDefinitionInfoList, 1);
entry->value = info;
entry->next = *cpu_list;
*cpu_list = entry;
@@ -574,7 +574,7 @@ CpuModelExpansionInfo *arch_query_cpu_model_expansion(CpuModelExpansionType type
}
/* convert it back to a static representation */
- expansion_info = g_malloc0(sizeof(*expansion_info));
+ expansion_info = g_new0(CpuModelExpansionInfo, 1);
expansion_info->model = g_malloc0(sizeof(*expansion_info->model));
cpu_info_from_model(expansion_info->model, &s390_model, delta_changes);
return expansion_info;
@@ -585,7 +585,7 @@ static void list_add_feat(const char *name, void *opaque)
strList **last = (strList **) opaque;
strList *entry;
- entry = g_malloc0(sizeof(*entry));
+ entry = g_new0(strList, 1);
entry->value = g_strdup(name);
entry->next = *last;
*last = entry;
@@ -609,7 +609,7 @@ CpuModelCompareInfo *arch_query_cpu_model_comparison(CpuModelInfo *infoa,
if (*errp) {
return NULL;
}
- compare_info = g_malloc0(sizeof(*compare_info));
+ compare_info = g_new0(CpuModelCompareInfo, 1);
/* check the cpu generation and ga level */
if (modela.def->gen == modelb.def->gen) {
@@ -713,7 +713,7 @@ CpuModelBaselineInfo *arch_query_cpu_model_baseline(CpuModelInfo *infoa,
bitmap_and(model.features, model.features, model.def->full_feat,
S390_FEAT_MAX);
- baseline_info = g_malloc0(sizeof(*baseline_info));
+ baseline_info = g_new0(CpuModelBaselineInfo, 1);
baseline_info->model = g_malloc0(sizeof(*baseline_info->model));
cpu_info_from_model(baseline_info->model, &model, true);
return baseline_info;
diff --git a/target/s390x/diag.c b/target/s390x/diag.c
index 82a623948d..dbbb9e886f 100644
--- a/target/s390x/diag.c
+++ b/target/s390x/diag.c
@@ -144,7 +144,7 @@ void handle_diag_308(CPUS390XState *env, uint64_t r1, uint64_t r3)
program_interrupt(env, PGM_ADDRESSING, ILEN_AUTO);
return;
}
- iplb = g_malloc0(sizeof(IplParameterBlock));
+ iplb = g_new0(IplParameterBlock, 1);
cpu_physical_memory_read(addr, iplb, sizeof(iplb->len));
if (!iplb_valid_len(iplb)) {
env->regs[r1 + 1] = DIAG_308_RC_INVALID;
--
2.13.6
next prev parent reply other threads:[~2017-10-20 11:54 UTC|newest]
Thread overview: 48+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-20 11:53 [Qemu-devel] [PULL 00/46] more s390x patches for 2.11 Cornelia Huck
2017-10-20 11:53 ` Cornelia Huck [this message]
2017-10-20 11:53 ` [Qemu-devel] [PULL 02/46] s390x/css: be more consistent if broken beyond repair Cornelia Huck
2017-10-20 11:53 ` [Qemu-devel] [PULL 03/46] s390x/tcg: turn INTERRUPT_EXT into a mask Cornelia Huck
2017-10-20 11:53 ` [Qemu-devel] [PULL 04/46] s390x/tcg: cleanup service interrupt injection Cornelia Huck
2017-10-20 11:53 ` [Qemu-devel] [PULL 05/46] s390x/tcg: injection of emergency signals and external calls Cornelia Huck
2017-10-20 11:53 ` [Qemu-devel] [PULL 06/46] s390x/tcg: rework checking for deliverable interrupts Cornelia Huck
2017-10-20 11:53 ` [Qemu-devel] [PULL 07/46] s390x/tcg: take care of external interrupt subclasses Cornelia Huck
2017-10-20 11:53 ` [Qemu-devel] [PULL 08/46] s390x/tcg: STOPPED cpus can never wake up Cornelia Huck
2017-10-20 11:53 ` [Qemu-devel] [PULL 09/46] s390x/tcg: a CPU cannot switch state due to an interrupt Cornelia Huck
2017-10-20 11:53 ` [Qemu-devel] [PULL 10/46] target/s390x: factor out handling of WAIT PSW into s390_handle_wait() Cornelia Huck
2017-10-20 11:53 ` [Qemu-devel] [PULL 11/46] s390x/tcg: handle WAIT PSWs during interrupt injection Cornelia Huck
2017-10-20 11:53 ` [Qemu-devel] [PULL 12/46] target/s390x: interpret PSW_MASK_WAIT only for TCG Cornelia Huck
2017-10-20 11:53 ` [Qemu-devel] [PULL 13/46] s390x/kvm: pass ipb directly into handle_sigp() Cornelia Huck
2017-10-20 11:53 ` [Qemu-devel] [PULL 14/46] s390x/kvm: generalize SIGP stop and restart interrupt injection Cornelia Huck
2017-10-20 11:53 ` [Qemu-devel] [PULL 15/46] s390x/kvm: factor out storing of CPU status Cornelia Huck
2017-10-20 11:53 ` [Qemu-devel] [PULL 16/46] s390x/kvm: factor out storing of adtl " Cornelia Huck
2017-10-20 11:53 ` [Qemu-devel] [PULL 17/46] s390x/kvm: drop two debug prints Cornelia Huck
2017-10-20 11:53 ` [Qemu-devel] [PULL 18/46] s390x/kvm: factor out SIGP code into sigp.c Cornelia Huck
2017-10-20 11:53 ` [Qemu-devel] [PULL 19/46] s390x/kvm: factor out actual handling of STOP interrupts Cornelia Huck
2017-10-20 11:53 ` [Qemu-devel] [PULL 20/46] s390x/tcg: implement SIGP SENSE RUNNING STATUS Cornelia Huck
2017-10-20 11:53 ` [Qemu-devel] [PULL 21/46] s390x/tcg: implement SIGP SENSE Cornelia Huck
2017-10-20 11:53 ` [Qemu-devel] [PULL 22/46] s390x/tcg: implement SIGP EXTERNAL CALL Cornelia Huck
2017-10-20 11:53 ` [Qemu-devel] [PULL 23/46] s390x/tcg: implement SIGP EMERGENCY SIGNAL Cornelia Huck
2017-10-20 11:53 ` [Qemu-devel] [PULL 24/46] s390x/tcg: implement SIGP CONDITIONAL " Cornelia Huck
2017-10-20 11:53 ` [Qemu-devel] [PULL 25/46] s390x/tcg: implement STOP and RESET interrupts for TCG Cornelia Huck
2017-10-20 11:53 ` [Qemu-devel] [PULL 26/46] s390x/tcg: flush the tlb on SIGP SET PREFIX Cornelia Huck
2017-10-20 11:53 ` [Qemu-devel] [PULL 27/46] s390x/tcg: switch to new SIGP handling code Cornelia Huck
2017-10-20 11:54 ` [Qemu-devel] [PULL 28/46] s390x/cpumodel: allow to enable SENSE RUNNING STATUS for qemu Cornelia Huck
2017-10-20 11:54 ` [Qemu-devel] [PULL 29/46] s390x/tcg: unlock NMI Cornelia Huck
2017-10-20 11:54 ` [Qemu-devel] [PULL 30/46] s390x/tcg: refactor stfl(e) to use s390_get_feat_block() Cornelia Huck
2017-10-20 11:54 ` [Qemu-devel] [PULL 31/46] target/s390x: special handling when starting a CPU with WAIT PSW Cornelia Huck
2017-10-20 11:54 ` [Qemu-devel] [PULL 32/46] virtio-ccw: Add the virtio-input devices for CCW bus Cornelia Huck
2017-10-20 11:54 ` [Qemu-devel] [PULL 33/46] s390x/MAINTAINERS: add mailing list Cornelia Huck
2017-10-20 11:54 ` [Qemu-devel] [PULL 34/46] s390x/event-facility: variable-length event masks Cornelia Huck
2017-10-20 11:54 ` [Qemu-devel] [PULL 35/46] s390x: fix cpu object referrence leak in s390x_new_cpu() Cornelia Huck
2017-10-20 11:54 ` [Qemu-devel] [PULL 36/46] s390x: move s390x_new_cpu() into board code Cornelia Huck
2017-10-20 11:54 ` [Qemu-devel] [PULL 37/46] s390x/css: IO instr handler ending control Cornelia Huck
2017-10-20 11:54 ` [Qemu-devel] [PULL 38/46] s390x: improve error handling for SSCH and RSCH Cornelia Huck
2017-10-20 11:54 ` [Qemu-devel] [PULL 39/46] s390x: refactor error handling for XSCH handler Cornelia Huck
2017-10-20 11:54 ` [Qemu-devel] [PULL 40/46] s390x: refactor error handling for CSCH handler Cornelia Huck
2017-10-20 11:54 ` [Qemu-devel] [PULL 41/46] s390x: refactor error handling for HSCH handler Cornelia Huck
2017-10-20 11:54 ` [Qemu-devel] [PULL 42/46] s390x: refactor error handling for MSCH handler Cornelia Huck
2017-10-20 11:54 ` [Qemu-devel] [PULL 43/46] libqtest: Add qtest_[v]startf() Cornelia Huck
2017-10-20 11:54 ` [Qemu-devel] [PULL 44/46] tests: Enable the very simple virtio tests on s390x, too Cornelia Huck
2017-10-20 11:54 ` [Qemu-devel] [PULL 45/46] accel/tcg: allow to invalidate a write TLB entry immediately Cornelia Huck
2017-10-20 11:54 ` [Qemu-devel] [PULL 46/46] s390x/tcg: low-address protection support Cornelia Huck
2017-10-20 14:03 ` [Qemu-devel] [PULL 00/46] more s390x patches for 2.11 Peter Maydell
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=20171020115418.2050-2-cohuck@redhat.com \
--to=cohuck@redhat.com \
--cc=agraf@suse.de \
--cc=borntraeger@de.ibm.com \
--cc=david@redhat.com \
--cc=f4bug@amsat.org \
--cc=marcandre.lureau@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-s390x@nongnu.org \
--cc=rth@twiddle.net \
--cc=thuth@redhat.com \
/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).