qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH for-7.1 2/4] target/loongarch: Trim type name suffix in -cpu


From: Richard Henderson
Subject: Re: [PATCH for-7.1 2/4] target/loongarch: Trim type name suffix in -cpu help output
Date: Sun, 14 Aug 2022 15:45:59 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0

On 8/14/22 09:55, WANG Xuerui wrote:
From: WANG Xuerui <git@xen0n.name>

Also add a header and indentation for each entry, while at it.

Signed-off-by: WANG Xuerui <git@xen0n.name>
---
  target/loongarch/cpu.c | 4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/target/loongarch/cpu.c b/target/loongarch/cpu.c
index dc233ee209..4663539443 100644
--- a/target/loongarch/cpu.c
+++ b/target/loongarch/cpu.c
@@ -416,13 +416,15 @@ static void loongarch_la464_initfn(Object *obj)
  static void loongarch_cpu_list_entry(gpointer data, gpointer user_data)
  {
      const char *typename = object_class_get_name(OBJECT_CLASS(data));
+    int len = strlen(typename) - strlen(LOONGARCH_CPU_TYPE_SUFFIX);
- qemu_printf("%s\n", typename);
+    qemu_printf("  %.*s\n", len, typename);
  }
void loongarch_cpu_list(void)
  {
      GSList *list;
+    qemu_printf("Available CPUs:\n");
      list = object_class_get_list_sorted(TYPE_LOONGARCH_CPU, false);
      g_slist_foreach(list, loongarch_cpu_list_entry, NULL);
      g_slist_free(list);

This should be merged with the previous patch, so that we don't have an intermediate state where help and loongarch_cpu_class_by_name disagree.


r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]