Re: [PATCH v3 2/5] staging: rtl8723bs: rtw_mlme: fix lines exceeding 100 columns

Luka Gejak
2026-04-27T06:02:58Z

On Mon Apr 27, 2026 at 12:54 AM CEST, Salman Alghamdi wrote:
> Wrap long lines and extract local variables to bring all lines
> within the 100 column limit.
>
> Signed-off-by: Salman Alghamdi <me@cipherat.com>
> ---

...

> @@ -746,9 +791,13 @@ void rtw_surveydone_event_callback(struct adapter *adapter, u8 *pbuf)
> rtw_indicate_connect(adapter);
> } else {
> if (rtw_to_roam(adapter) != 0) {
> - if (rtw_dec_to_roam(adapter) == 0
> - || _SUCCESS != rtw_sitesurvey_cmd(adapter, &pmlmepriv->assoc_ssid, 1, NULL, 0)
> - ) {
> + if (rtw_dec_to_roam(adapter) == 0) {
> + rtw_set_to_roam(adapter, 0);
> + rtw_free_assoc_resources(adapter, 1);
> + rtw_indicate_disconnect(adapter);
> + } else if (rtw_sitesurvey_cmd(adapter,
> + &pmlmepriv->assoc_ssid,
> + 1, NULL, 0) != _SUCCESS) {
> rtw_set_to_roam(adapter, 0);
> rtw_free_assoc_resources(adapter, 1);
> rtw_indicate_disconnect(adapter);

This isn't really what I had in mind and it isn't acceptable because you
are repeating yourself. I thought something like:
bool roam_failed = false;
if (rtw_dec_to_roam(adapter) == 0)
roam_failed = true;
else if (rtw_sitesurvey_cmd(adapter, &pmlmepriv->assoc_ssid,
1, NULL, 0) != _SUCCESS)
roam_failed = true;
if (roam_failed) {
rtw_set_to_roam(adapter, 0);
rtw_free_assoc_resources(adapter, 1);
rtw_indicate_disconnect(adapter);
}

...

Best regards,
Luka Gejak