[PATCH 4/6] target/s390x/cpu_models: Drop local @err in get_max_cpu_model()

Zhao Liu posted 6 patches 1 year, 9 months ago
Maintainers: David Hildenbrand <david@redhat.com>, Thomas Huth <thuth@redhat.com>, Richard Henderson <richard.henderson@linaro.org>, Ilya Leoshkevich <iii@linux.ibm.com>, Halil Pasic <pasic@linux.ibm.com>, Christian Borntraeger <borntraeger@linux.ibm.com>
There is a newer version of this series
[PATCH 4/6] target/s390x/cpu_models: Drop local @err in get_max_cpu_model()
Posted by Zhao Liu 1 year, 9 months ago
From: Zhao Liu <zhao1.liu@intel.com>

Use @errp to fetech error information directly and drop the local
virable @err.

Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
---
 target/s390x/cpu_models.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c
index a0e4acb707d7..aae452cfd3fc 100644
--- a/target/s390x/cpu_models.c
+++ b/target/s390x/cpu_models.c
@@ -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 {
-- 
2.34.1
Re: [PATCH 4/6] target/s390x/cpu_models: Drop local @err in get_max_cpu_model()
Posted by Thomas Huth 1 year, 9 months ago
On 19/04/2024 08.57, Zhao Liu wrote:
> From: Zhao Liu <zhao1.liu@intel.com>
> 
> Use @errp to fetech error information directly and drop the local
> virable @err.

Copy-n-paste of the same typos as in patch 2 ;-)

> Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
> ---
>   target/s390x/cpu_models.c | 4 +---
>   1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c
> index a0e4acb707d7..aae452cfd3fc 100644
> --- a/target/s390x/cpu_models.c
> +++ b/target/s390x/cpu_models.c
> @@ -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 {

With the typos fixed:
Reviewed-by: Thomas Huth <thuth@redhat.com>