target/s390x/cpu_model: Drop local @err in s390_realize_cpu_model()
authorZhao Liu <zhao1.liu@intel.com>
Thu, 25 Apr 2024 03:12:27 +0000 (11:12 +0800)
committerThomas Huth <thuth@redhat.com>
Tue, 30 Apr 2024 04:21:47 +0000 (06:21 +0200)
Use @errp to fetch error information directly and drop the local
variable @err.

Suggested-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20240425031232.1586401-3-zhao1.liu@intel.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
target/s390x/cpu_models.c

index 8cb47d905fb4b8171b901f5102c65d611101015f..052540a866ac4c3c9c5125b4a4df1975b714d1dd 100644 (file)
@@ -577,7 +577,6 @@ S390CPUModel *get_max_cpu_model(Error **errp)
 void s390_realize_cpu_model(CPUState *cs, Error **errp)
 {
     ERRP_GUARD();
-    Error *err = NULL;
     S390CPUClass *xcc = S390_CPU_GET_CLASS(cs);
     S390CPU *cpu = S390_CPU(cs);
     const S390CPUModel *max_model;
@@ -606,8 +605,7 @@ void s390_realize_cpu_model(CPUState *cs, Error **errp)
     cpu->model->cpu_ver = max_model->cpu_ver;
 
     check_consistency(cpu->model);
-    if (!check_compatibility(max_model, cpu->model, &err)) {
-        error_propagate(errp, err);
+    if (!check_compatibility(max_model, cpu->model, errp)) {
         return;
     }