From: James Prestwood <prestwoj@gmail.com>
To: Denis Kenzior <denkenz@gmail.com>, iwd@lists.linux.dev
Subject: Re: [PATCH v2 3/5] dpp: explicitly disconnect station if enrollee is started
Date: Wed, 24 Jul 2024 08:17:48 -0700 [thread overview]
Message-ID: <5270e5fa-e1e4-472b-8598-3093edfcffea@gmail.com> (raw)
In-Reply-To: <683fd9f7-f724-4abf-aa6d-883d12b57aae@gmail.com>
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
next prev parent reply other threads:[~2024-07-24 15:17 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-22 18:29 [PATCH v2 1/5] dpp: factor out PKEX/DPP start prep into function James Prestwood
2024-07-22 18:29 ` [PATCH v2 2/5] station: add station_get_autoconnect James Prestwood
2024-07-22 18:29 ` [PATCH v2 3/5] dpp: explicitly disconnect station if enrollee is started James Prestwood
2024-07-24 14:30 ` Denis Kenzior
2024-07-24 14:53 ` James Prestwood
2024-07-24 15:15 ` Denis Kenzior
2024-07-24 15:17 ` James Prestwood [this message]
2024-07-22 18:29 ` [PATCH v2 4/5] auto-t: add DPP tests for state change checks James Prestwood
2024-07-22 18:29 ` [PATCH v2 5/5] auto-t: fix several DPP tests after station state changes James Prestwood
-- strict thread matches above, loose matches on Subject: below --
2024-07-24 15:46 [PATCH v2 1/5] dpp: factor out PKEX/DPP start prep into function James Prestwood
2024-07-24 15:46 ` [PATCH v2 3/5] dpp: explicitly disconnect station if enrollee is started James Prestwood
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5270e5fa-e1e4-472b-8598-3093edfcffea@gmail.com \
--to=prestwoj@gmail.com \
--cc=denkenz@gmail.com \
--cc=iwd@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox