target/s390x/cpu_models: Drop local @err in get_max_cpu_model()
authorZhao Liu <zhao1.liu@intel.com>
Thu, 25 Apr 2024 03:12:30 +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.

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

index a0e4acb707d7ebd7afcdcc60abc76aa41701d08c..aae452cfd3fcd8147ef77e17b9644c69fb905954 100644 (file)
@@ -551,7 +551,6 @@ static bool check_compatibility(const S390CPUModel *max_model,
 
 S390CPUModel *get_max_cpu_model(Error **errp)
 {
-    Error *err = NULL;
     static S390CPUModel max_model;
     static bool cached;
 
@@ -560,8 +559,7 @@ S390CPUModel *get_max_cpu_model(Error **errp)
     }
 
     if (kvm_enabled()) {
-        if (!kvm_s390_get_host_cpu_model(&max_model, &err)) {
-            error_propagate(errp, err);
+        if (!kvm_s390_get_host_cpu_model(&max_model, errp)) {
             return NULL;
         }
     } else {