[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v3 4/4] target-openrisc: Fix cpu_model by name
From: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] [PATCH v3 4/4] target-openrisc: Fix cpu_model by name |
Date: |
Mon, 22 Jul 2013 10:29:36 +0100 |
On 22 July 2013 09:56, Jia Liu <address@hidden> wrote:
> Fix cpu_model by name, make any and or1200 works both OK.
>
> Signed-off-by: Jia Liu <address@hidden>
> ---
> target-openrisc/cpu.c | 16 ++++++++++++----
> 1 file changed, 12 insertions(+), 4 deletions(-)
>
> diff --git a/target-openrisc/cpu.c b/target-openrisc/cpu.c
> index e348df0..6637166 100644
> --- a/target-openrisc/cpu.c
> +++ b/target-openrisc/cpu.c
> @@ -100,11 +100,19 @@ static ObjectClass *openrisc_cpu_class_by_name(const
> char *cpu_model)
> typename = g_strdup_printf("%s-" TYPE_OPENRISC_CPU, cpu_model);
> oc = object_class_by_name(typename);
> g_free(typename);
> - if (oc != NULL && (!object_class_dynamic_cast(oc, TYPE_OPENRISC_CPU) ||
> - object_class_is_abstract(oc))) {
> - return NULL;
> +
> + if (oc != NULL && object_class_dynamic_cast(oc, TYPE_OPENRISC_CPU) !=
> NULL
> + && !object_class_is_abstract(oc)) {
> + return oc;
> }
> - return oc;
> +
> + oc = object_class_by_name(cpu_model);
> + if (oc != NULL && object_class_dynamic_cast(oc, TYPE_OPENRISC_CPU) !=
> NULL
> + && !object_class_is_abstract(oc)) {
> + return oc;
> + }
> +
> + return NULL;
> }
This looks a bit odd. The commit message suggests it's an
attempt to fix the bug that was fixed by commit 071b3364e --
is it really needed? Andreas?
thanks
-- PMM
- [Qemu-devel] [PATCH v3 0/4] target-openrisc hw/openrisc: Some OpenRISC fix., Jia Liu, 2013/07/22
- [Qemu-devel] [PATCH v3 4/4] target-openrisc: Fix cpu_model by name, Jia Liu, 2013/07/22
- Re: [Qemu-devel] [PATCH v3 4/4] target-openrisc: Fix cpu_model by name,
Peter Maydell <=
- Re: [Qemu-devel] [PATCH v3 4/4] target-openrisc: Fix cpu_model by name, Jia Liu, 2013/07/22
- Re: [Qemu-devel] [PATCH v3 4/4] target-openrisc: Fix cpu_model by name, Peter Maydell, 2013/07/22
- Re: [Qemu-devel] [PATCH v3 4/4] target-openrisc: Fix cpu_model by name, Jia Liu, 2013/07/22
- Re: [Qemu-devel] [PATCH v3 4/4] target-openrisc: Fix cpu_model by name, Jia Liu, 2013/07/22
- Re: [Qemu-devel] [PATCH v3 4/4] target-openrisc: Fix cpu_model by name, Andreas Färber, 2013/07/22
- Re: [Qemu-devel] [PATCH v3 4/4] target-openrisc: Fix cpu_model by name, Peter Maydell, 2013/07/22
- Re: [Qemu-devel] [PATCH v3 4/4] target-openrisc: Fix cpu_model by name, Andreas Färber, 2013/07/22
- Re: [Qemu-devel] [PATCH v3 4/4] target-openrisc: Fix cpu_model by name, Peter Maydell, 2013/07/22
- Re: [Qemu-devel] -cpu behavior (was: [PATCH v3 4/4] target-openrisc: Fix cpu_model by name), Andreas Färber, 2013/07/22
- Re: [Qemu-devel] [PATCH v3 4/4] target-openrisc: Fix cpu_model by name, Andreas Färber, 2013/07/22