From: Richard Henderson <richard.henderson@linaro.org>
To: "Philippe Mathieu-Daudé" <f4bug@amsat.org>, qemu-devel@nongnu.org
Cc: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>,
Artyom Tarasenko <atar4qemu@gmail.com>
Subject: Re: [PATCH v2 6/6] hw/sparc/sun4m: Move each sun4m_hwdef definition in its class_init
Date: Mon, 3 May 2021 09:27:38 -0700 [thread overview]
Message-ID: <d29589e2-ae7b-0569-d422-e59642f2fdac@linaro.org> (raw)
In-Reply-To: <20210502185441.599980-7-f4bug@amsat.org>
On 5/2/21 11:54 AM, Philippe Mathieu-Daudé wrote:
> +static void ss5_class_init(ObjectClass *oc, void *data)
> +{
> + MachineClass *mc = MACHINE_CLASS(oc);
> + Sun4mMachineClass *smc = SUN4M_MACHINE_CLASS(mc);
> +
> + mc->desc = "Sun4m platform, SPARCstation 5";
> + mc->is_default = true;
> + mc->default_cpu_type = SPARC_CPU_TYPE_NAME("Fujitsu-MB86904");
> + smc->hwdef = &(const struct sun4m_hwdef) {
> .iommu_base = 0x10000000,
> .iommu_pad_base = 0x10004000,
> .iommu_pad_len = 0x0fffb000,
This is incorrect. You're creating an anonymous object on the local stack
frame and saving a pointer to it.
You need to use a static const function scope variable.
r~
next prev parent reply other threads:[~2021-05-03 16:30 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-02 18:54 [PATCH v2 0/6] hw/sparc/sun4m: Introduce Sun4mMachineClass to access sun4m_hwdefs Philippe Mathieu-Daudé
2021-05-02 18:54 ` [PATCH v2 1/6] hw/sparc/sun4m: Have sun4m machines inherit new TYPE_SUN4M_MACHINE Philippe Mathieu-Daudé
2021-05-03 16:18 ` Richard Henderson
2021-05-02 18:54 ` [PATCH v2 2/6] hw/sparc/sun4m: Introduce Sun4mMachineClass Philippe Mathieu-Daudé
2021-05-03 16:24 ` Richard Henderson
2021-05-02 18:54 ` [PATCH v2 3/6] hw/sparc/sun4m: Factor out sun4m_machine_class_init() Philippe Mathieu-Daudé
2021-05-03 16:25 ` Richard Henderson
2021-05-02 18:54 ` [PATCH v2 4/6] hw/sparc/sun4m: Register machine types in sun4m_machine_types[] Philippe Mathieu-Daudé
2021-05-03 16:25 ` Richard Henderson
2021-05-02 18:54 ` [PATCH v2 5/6] hw/sparc/sun4m: Fix code style for checkpatch.pl Philippe Mathieu-Daudé
2021-05-03 16:25 ` Richard Henderson
2021-05-02 18:54 ` [PATCH v2 6/6] hw/sparc/sun4m: Move each sun4m_hwdef definition in its class_init Philippe Mathieu-Daudé
2021-05-03 16:27 ` Richard Henderson [this message]
2021-05-03 16:35 ` Philippe Mathieu-Daudé
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=d29589e2-ae7b-0569-d422-e59642f2fdac@linaro.org \
--to=richard.henderson@linaro.org \
--cc=atar4qemu@gmail.com \
--cc=f4bug@amsat.org \
--cc=mark.cave-ayland@ilande.co.uk \
--cc=qemu-devel@nongnu.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 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).