All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: "Philippe Mathieu-Daudé" <philmd@linaro.org>
Cc: qemu-devel@nongnu.org,  Jiaxun Yang <jiaxun.yang@flygoat.com>,
	 Markus Armbruster <armbru@redhat.com>
Subject: Re: [PATCH-for-9.0] hw/mips/cps: Simplify access to 'start-powered-off' property
Date: Thu, 23 Nov 2023 07:53:19 +0100	[thread overview]
Message-ID: <87o7fl7yg0.fsf@pond.sub.org> (raw)
In-Reply-To: <20231122183633.17676-1-philmd@linaro.org> ("Philippe Mathieu-Daudé"'s message of "Wed, 22 Nov 2023 19:36:33 +0100")

Philippe Mathieu-Daudé <philmd@linaro.org> writes:

> Since commit c1b701587e ("target/arm: Move start-powered-off
> property to generic CPUState"), all target CPUs have the
> 'start-powered-off' property.
>
> This object_property_set_bool() call can not fail. Use &error_abort
> to simplify.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>  hw/mips/cps.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/hw/mips/cps.c b/hw/mips/cps.c
> index b6612c1762..4f12e23ab5 100644
> --- a/hw/mips/cps.c
> +++ b/hw/mips/cps.c
> @@ -78,10 +78,9 @@ static void mips_cps_realize(DeviceState *dev, Error **errp)
>          CPUMIPSState *env = &cpu->env;
>  
>          /* All VPs are halted on reset. Leave powering up to CPC. */
> -        if (!object_property_set_bool(OBJECT(cpu), "start-powered-off", true,
> -                                      errp)) {
> -            return;
> -        }
> +        object_property_set_bool(OBJECT(cpu), "start-powered-off", true,
> +                                 &error_abort);
> +
>          /* All cores use the same clock tree */
>          qdev_connect_clock_in(DEVICE(cpu), "clk-in", s->clock);

There are more:

    $ git-grep -A 1 'object_prop.*start-powered-off'
    hw/arm/armsse.c:1025:            if (!object_property_set_bool(cpuobj, "start-powered-off", true,
    hw/arm/armsse.c-1026-                                          errp)) {
    --
    hw/arm/armv7m.c:321:    if (object_property_find(OBJECT(s->cpu), "start-powered-off")) {
    hw/arm/armv7m.c:322:        if (!object_property_set_bool(OBJECT(s->cpu), "start-powered-off",
    hw/arm/armv7m.c-323-                                      s->start_powered_off, errp)) {
    --
    hw/arm/boot.c:1290:                object_property_set_bool(cpuobj, "start-powered-off", true,
    hw/arm/boot.c-1291-                                         &error_abort);
    --
    hw/arm/fsl-imx6.c:131:            object_property_set_bool(OBJECT(&s->cpu[i]), "start-powered-off",
    hw/arm/fsl-imx6.c-132-                                     true, &error_abort);
    --
    hw/arm/fsl-imx7.c:195:            object_property_set_bool(o, "start-powered-off", true,
    hw/arm/fsl-imx7.c-196-                                     &error_abort);
    --
    hw/arm/xlnx-versal.c:51:            object_property_set_bool(obj, "start-powered-off", true,
    hw/arm/xlnx-versal.c-52-                                     &error_abort);
    --
    hw/arm/xlnx-versal.c:153:        object_property_set_bool(obj, "start-powered-off", true,
    hw/arm/xlnx-versal.c-154-                                 &error_abort);
    --
    hw/mips/cps.c:81:        if (!object_property_set_bool(OBJECT(cpu), "start-powered-off", true,
    hw/mips/cps.c-82-                                      errp)) {
    --
    hw/ppc/e500.c:957:        object_property_set_bool(OBJECT(cs), "start-powered-off", i != 0,
    hw/ppc/e500.c-958-                                 &error_fatal);
    --
    hw/sparc/sun4m.c:806:    object_property_set_bool(OBJECT(cpu), "start-powered-off", id != 0,
    hw/sparc/sun4m.c-807-                             &error_fatal);

We also set the property with qdev_prop_set_bit() in places, which is a
trivial wrapper around object_property_set_bool() that passes
&error_abort.  Either is fine, I think.



  reply	other threads:[~2023-11-23  6:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-22 18:36 [PATCH-for-9.0] hw/mips/cps: Simplify access to 'start-powered-off' property Philippe Mathieu-Daudé
2023-11-23  6:53 ` Markus Armbruster [this message]
2023-11-23 14:39   ` 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=87o7fl7yg0.fsf@pond.sub.org \
    --to=armbru@redhat.com \
    --cc=jiaxun.yang@flygoat.com \
    --cc=philmd@linaro.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.