From: Cornelia Huck <cohuck@redhat.com>
To: Greg Kurz <groug@kaod.org>
Cc: "Laurent Vivier" <lvivier@redhat.com>,
"Peter Maydell" <peter.maydell@linaro.org>,
"Eduardo Habkost" <ehabkost@redhat.com>,
"David Hildenbrand" <david@redhat.com>,
qemu-devel@nongnu.org,
"Alistair Francis" <alistair.francis@wdc.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Philippe Mathieu-Daudé" <philmd@redhat.com>,
"David Gibson" <david@gibson.dropbear.id.au>
Subject: Re: [for-5.0 PATCH 3/3] cpu: Use cpu_class_set_parent_reset()
Date: Mon, 9 Dec 2019 10:13:43 +0100 [thread overview]
Message-ID: <20191209101343.54333073.cohuck@redhat.com> (raw)
In-Reply-To: <157565784603.3897844.16391025294328116481.stgit@bahia.lan>
On Fri, 06 Dec 2019 19:44:06 +0100
Greg Kurz <groug@kaod.org> wrote:
> Convert all targets to use cpu_class_set_parent_reset() with the following
> coccinelle script:
>
> @@
> type CPUParentClass;
> CPUParentClass *pcc;
> CPUClass *cc;
> identifier parent_fn;
> identifier child_fn;
> @@
> +cpu_class_set_parent_reset(cc, child_fn, &pcc->parent_fn);
> -pcc->parent_fn = cc->reset;
> ...
> -cc->reset = child_fn;
>
> Signed-off-by: Greg Kurz <groug@kaod.org>
> ---
> target/arm/cpu.c | 3 +--
> target/cris/cpu.c | 3 +--
> target/i386/cpu.c | 3 +--
> target/lm32/cpu.c | 3 +--
> target/m68k/cpu.c | 3 +--
> target/microblaze/cpu.c | 3 +--
> target/mips/cpu.c | 3 +--
> target/moxie/cpu.c | 3 +--
> target/nios2/cpu.c | 3 +--
> target/openrisc/cpu.c | 3 +--
> target/ppc/translate_init.inc.c | 3 +--
> target/riscv/cpu.c | 3 +--
> target/s390x/cpu.c | 3 +--
> target/sh4/cpu.c | 3 +--
> target/sparc/cpu.c | 3 +--
> target/tilegx/cpu.c | 3 +--
> target/tricore/cpu.c | 3 +--
> target/xtensa/cpu.c | 3 +--
> 18 files changed, 18 insertions(+), 36 deletions(-)
>
> diff --git a/target/s390x/cpu.c b/target/s390x/cpu.c
> index 3abe7e80fd0a..cf7cf5655fbc 100644
> --- a/target/s390x/cpu.c
> +++ b/target/s390x/cpu.c
> @@ -469,13 +469,12 @@ static void s390_cpu_class_init(ObjectClass *oc, void *data)
> dc->props = s390x_cpu_properties;
> dc->user_creatable = true;
>
> - scc->parent_reset = cc->reset;
> + cpu_class_set_parent_reset(cc, s390_cpu_full_reset, &scc->parent_reset);
> #if !defined(CONFIG_USER_ONLY)
> scc->load_normal = s390_cpu_load_normal;
> #endif
> scc->cpu_reset = s390_cpu_reset;
> scc->initial_cpu_reset = s390_cpu_initial_reset;
> - cc->reset = s390_cpu_full_reset;
> cc->class_by_name = s390_cpu_class_by_name,
> cc->has_work = s390_cpu_has_work;
> #ifdef CONFIG_TCG
Also looks sane, but needs a tweak to apply on top of the s390-next
branch as well.
prev parent reply other threads:[~2019-12-09 9:14 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-06 18:43 [for-5.0 PATCH 0/3] cpu: Clarify overloading of reset QOM methods Greg Kurz
2019-12-06 18:43 ` [for-5.0 PATCH 1/3] cpu: Introduce CPUReset callback typedef Greg Kurz
2019-12-09 0:51 ` David Gibson
2019-12-09 5:32 ` Alistair Francis
2019-12-09 9:06 ` Cornelia Huck
2019-12-06 18:44 ` [for-5.0 PATCH 2/3] cpu: Introduce cpu_class_set_parent_reset() Greg Kurz
2019-12-09 0:51 ` David Gibson
2019-12-09 5:36 ` Alistair Francis
2019-12-09 9:12 ` Cornelia Huck
2019-12-06 18:44 ` [for-5.0 PATCH 3/3] cpu: Use cpu_class_set_parent_reset() Greg Kurz
2019-12-09 0:51 ` David Gibson
2019-12-09 5:36 ` Alistair Francis
2019-12-09 9:13 ` Cornelia Huck [this message]
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=20191209101343.54333073.cohuck@redhat.com \
--to=cohuck@redhat.com \
--cc=alistair.francis@wdc.com \
--cc=david@gibson.dropbear.id.au \
--cc=david@redhat.com \
--cc=ehabkost@redhat.com \
--cc=groug@kaod.org \
--cc=lvivier@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=philmd@redhat.com \
--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).