[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v8 16/19] hvf: arm: Implement PSCI handling
From: |
Alexander Graf |
Subject: |
Re: [PATCH v8 16/19] hvf: arm: Implement PSCI handling |
Date: |
Sun, 12 Sep 2021 23:37:54 +0200 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 |
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!
Alex