Re: [PATCH v2 3/5] dpp: explicitly disconnect station if enrollee is started

James Prestwood
2024-07-24T15:17:51Z

Hi Denis,

On 7/24/24 8:15 AM, Denis Kenzior wrote:
> Hi James,
>
>>>> +    /* Unusual case, but an enrollee could still be started */
>>>> +    if (!station)
>>>> +        return false;
>>>
>>> Function signature returns int, but you're returning false.
>>
>> Yep this is intended.
>>
>> true for a disconnect has started or is ongoing.
>> false for already disconnected
>> < 0 for a fatal error (i.e. station_disconnect() failed)
>>
>
> The typical convention is:
> -errno -> error
> 0 - > success
>
> You can extend this to mean that 0...INT_MAX is a success and return
> value simultaneously.  Mixing integers and bools is not what vast
> majority of people would expect and should be avoided.
>
>> If this isn't desirable we could do:
>>
>> -EALREADY for a disconnect is started/ongoing
>> 0 for already disconnected
>> < 0 for a fatal error
>
> That would be better.  Another alternative is:
>
> int dpp_try_disconnect_station(struct dpp_sm *dpp, bool
> *out_disconnect_started);
Ok, I'll do one of these instead.
>
> Regards,
> -Denis