qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH 17/17] target/s390x/cpu_models: Fix missing ERRP_GUARD() for


From: Zhao Liu
Subject: Re: [PATCH 17/17] target/s390x/cpu_models: Fix missing ERRP_GUARD() for error_prepend()
Date: Fri, 8 Mar 2024 18:12:15 +0800

Hi Thomas,

> >   void s390_realize_cpu_model(CPUState *cs, Error **errp)
> >   {
> > +    ERRP_GUARD();
> >       Error *err = NULL;
> 
> I think that function could use an additional clean-up now: Remove the local
> "err" variable and use "errp" only instead.
>

Since many cases check @err to determine if the callee function fails,
it's better also make those functions reture something like boolean
instead of void. Then we could avoid checking @err/@errp.

Thus, the remaining cleanups include:
* related conversion of local @err to @errp and
* make the callee function return someting,

I can do these centrally in another series, and this series (part 1 +
part 2, 33 patches in total) will only be used for adding ERRP_GUARD(),
which makes it easier to review as well as easier to merge.

Do you agree? ;-)

Thanks,
Zhao




reply via email to

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