public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Luka Gejak" <luka.gejak@linux.dev>
To: "Salman Alghamdi" <me@cipherat.com>, <gregkh@linuxfoundation.org>
Cc: <luka.gejak@linux.dev>, <straube.linux@gmail.com>,
	<linux-staging@lists.linux.dev>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v3 2/5] staging: rtl8723bs: rtw_mlme: fix lines exceeding 100 columns
Date: Mon, 27 Apr 2026 08:02:43 +0200	[thread overview]
Message-ID: <DI3PJU3MF1MT.1XDY33FGX6JEI@linux.dev> (raw)
In-Reply-To: <20260426225552.87114-3-me@cipherat.com>

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

  parent reply	other threads:[~2026-04-27  6:02 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-26 22:54 [PATCH v3 0/5] staging: rtl8723bs: rtw_mlme: fix long lines and related issues Salman Alghamdi
2026-04-26 22:54 ` [PATCH v3 1/5] staging: rtl8723bs: fix buffer over-read in rtw_update_protection Salman Alghamdi
2026-04-26 22:54 ` [PATCH v3 2/5] staging: rtl8723bs: rtw_mlme: fix lines exceeding 100 columns Salman Alghamdi
2026-04-27  5:50   ` Luka Gejak
2026-04-27  6:22     ` Luka Gejak
2026-04-27  6:02   ` Luka Gejak [this message]
2026-04-27  9:10   ` Dan Carpenter
2026-04-27 15:46     ` Salman Alghamdi
2026-04-27 16:02       ` Luka Gejak
2026-04-26 22:55 ` [PATCH v3 3/5] staging: rtl8723bs: rtw_mlme: remove dead commented-out code Salman Alghamdi
2026-04-27  5:32   ` Luka Gejak
2026-04-26 22:55 ` [PATCH v3 4/5] staging: rtl8723bs: rtw_mlme: consolidate capability comparisons lines Salman Alghamdi
2026-04-26 22:55 ` [PATCH v3 5/5] staging: rtl8723bs: rtw_mlme: add blank line for readability Salman Alghamdi
2026-04-26 23:12 ` [PATCH v3 0/5] staging: rtl8723bs: rtw_mlme: fix long lines and related issues Salman Alghamdi
2026-04-27  6:11   ` Luka Gejak
2026-04-27  9:01     ` Dan Carpenter

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=DI3PJU3MF1MT.1XDY33FGX6JEI@linux.dev \
    --to=luka.gejak@linux.dev \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=me@cipherat.com \
    --cc=straube.linux@gmail.com \
    /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