[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-ppc] [PATCH v2 17/24] ppc: move ppc_cpu_lookup_alias() before
From: |
David Gibson |
Subject: |
Re: [Qemu-ppc] [PATCH v2 17/24] ppc: move ppc_cpu_lookup_alias() before its first user |
Date: |
Tue, 10 Oct 2017 13:05:18 +1100 |
User-agent: |
Mutt/1.9.1 (2017-09-22) |
On Mon, Oct 09, 2017 at 09:51:04PM +0200, Igor Mammedov wrote:
> next commit will drop ppc_cpu_lookup_alias() declaration from header
> and make it static which will break its last user ppc_cpu_class_by_name()
> since ppc_cpu_class_by_name() defined before ppc_cpu_lookup_alias().
>
> To avoid this move ppc_cpu_lookup_alias() right before
> ppc_cpu_class_by_name().
>
> Signed-off-by: Igor Mammedov <address@hidden>
Acked-by: David Gibson <address@hidden>
> ---
> v2:
> - split from "ppc: spapr: use generic cpu_model parsing"
> were asked by David, it makes the next patch a little
> smaller
> ---
> target/ppc/translate_init.c | 26 +++++++++++++-------------
> 1 file changed, 13 insertions(+), 13 deletions(-)
>
> diff --git a/target/ppc/translate_init.c b/target/ppc/translate_init.c
> index 3d16481..17ac95b 100644
> --- a/target/ppc/translate_init.c
> +++ b/target/ppc/translate_init.c
> @@ -10060,6 +10060,19 @@ PowerPCCPUClass *ppc_cpu_class_by_pvr_mask(uint32_t
> pvr)
> return pcc;
> }
>
> +const char *ppc_cpu_lookup_alias(const char *alias)
> +{
> + int ai;
> +
> + for (ai = 0; ppc_cpu_aliases[ai].alias != NULL; ai++) {
> + if (strcmp(ppc_cpu_aliases[ai].alias, alias) == 0) {
> + return ppc_cpu_aliases[ai].model;
> + }
> + }
> +
> + return NULL;
> +}
> +
> static ObjectClass *ppc_cpu_class_by_name(const char *name)
> {
> char *cpu_model, *typename;
> @@ -10152,19 +10165,6 @@ static void ppc_cpu_parse_featurestr(const char
> *type, char *features,
> pcc->parent_parse_features(type, features, errp);
> }
>
> -const char *ppc_cpu_lookup_alias(const char *alias)
> -{
> - int ai;
> -
> - for (ai = 0; ppc_cpu_aliases[ai].alias != NULL; ai++) {
> - if (strcmp(ppc_cpu_aliases[ai].alias, alias) == 0) {
> - return ppc_cpu_aliases[ai].model;
> - }
> - }
> -
> - return NULL;
> -}
> -
> PowerPCCPUClass *ppc_cpu_get_family_class(PowerPCCPUClass *pcc)
> {
> ObjectClass *oc = OBJECT_CLASS(pcc);
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
signature.asc
Description: PGP signature
- Re: [Qemu-ppc] [PATCH v2 13/24] ppc: spapr: define core types statically, (continued)
Re: [Qemu-ppc] [Qemu-devel] [PATCH v2 13/24] ppc: spapr: define core types statically, Philippe Mathieu-Daudé, 2017/10/11
[Qemu-ppc] [PATCH v2 15/24] ppc: spapr: register 'host' core type along with the rest of core types, Igor Mammedov, 2017/10/09
[Qemu-ppc] [PATCH v2 14/24] ppc: spapr: use cpu type name directly, Igor Mammedov, 2017/10/09
[Qemu-ppc] [PATCH v2 16/24] ppc: spapr: use cpu model names as tcg defaults instead of aliases, Igor Mammedov, 2017/10/09
[Qemu-ppc] [PATCH v2 17/24] ppc: move ppc_cpu_lookup_alias() before its first user, Igor Mammedov, 2017/10/09
[Qemu-ppc] [PATCH v2 19/24] ppc: pnv: use generic cpu_model parsing, Igor Mammedov, 2017/10/09
[Qemu-ppc] [PATCH v2 18/24] ppc: spapr: use generic cpu_model parsing, Igor Mammedov, 2017/10/09
[Qemu-ppc] [PATCH v2 20/24] ppc: pnv: normalize core/chip type names, Igor Mammedov, 2017/10/09
[Qemu-ppc] [PATCH v2 22/24] ppc: pnv: define core types statically, Igor Mammedov, 2017/10/09