qemu-arm
[Top][All Lists]
Advanced

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

Re: [PATCH v8 16/19] hvf: arm: Implement PSCI handling


From: Richard Henderson
Subject: Re: [PATCH v8 16/19] hvf: arm: Implement PSCI handling
Date: Sun, 12 Sep 2021 14:40:31 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0

On 9/12/21 2:37 PM, Alexander Graf wrote:

On 12.09.21 23:20, Richard Henderson wrote:
On 9/12/21 1:36 PM, Alexander Graf wrote:
I think the callsites would be clearer if you made the function
return true for "PSCI call handled", false for "not recognised,
give the guest an UNDEF". Code like
           if (hvf_handle_psci_call(cpu)) {
               stuff;
           }

looks like the 'stuff' is for the "psci call handled" case,
which at the moment it isn't.


This function merely follows standard C semantics along the lines of "0
means success, !0 is error". Isn't that what you would usually expect?

No, not really.  I expect stuff that returns error codes to return
negative integers on failure.  I expect stuff that returns a boolean
success/failure to return true on success.


Fair, I'll change it to return -1 then. Thanks!

Not quite the point I was making. If the only two return values are -1/0, then bool false/true is in fact more appropriate.


r~



reply via email to

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