public inbox for linux-staging@lists.linux.dev
 help / color / mirror / Atom feed
From: Dan Carpenter <error27@gmail.com>
To: Salman Alghamdi <me@cipherat.com>
Cc: gregkh@linuxfoundation.org, luka.gejak@linux.dev,
	straube.linux@gmail.com, linux-staging@lists.linux.dev,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4 4/7] staging: rtl8723bs: rtw_mlme: extract local variables for long expressions
Date: Tue, 28 Apr 2026 14:55:06 +0300	[thread overview]
Message-ID: <afCgGuAShUy0RtVY@stanley.mountain> (raw)
In-Reply-To: <afB5jnwGX6H5j0PG@stanley.mountain>

On Tue, Apr 28, 2026 at 12:10:38PM +0300, Dan Carpenter wrote:
> On Mon, Apr 27, 2026 at 10:05:32PM +0300, Salman Alghamdi wrote:
> > @@ -772,9 +783,14 @@ 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)
> > -					) {
> > +					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) {
> 
> Just write this as:
> 					if (!rtw_dec_to_roam(adapter) ||
> 					    rtw_sitesurvey_cmd(adapter, &pmlmepriv->assoc_ssid,
> 							       1, NULL, 0) != _SUCCESS) {
> 
> The "roam_failed" variable isn't beautiful and the if else makes the line
> five characters longer than it would be otherwise.  Eventually we'll get
> rid of the _SUCCESS but I like it to look ugly so we know which code to
> change.

Do it by itself.  It doesn't fit in with patch 3 which just does
newline and it doesn't really fit in with this patch either.

regards,
dan carpenter


  parent reply	other threads:[~2026-04-28 11:55 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-27 19:05 [PATCH v4 0/7] staging: rtl8723bs: rtw_mlme: fix long lines and related issues Salman Alghamdi
2026-04-27 19:05 ` [PATCH v4 1/7] staging: rtl8723bs: fix buffer over-read in rtw_update_protection Salman Alghamdi
2026-04-27 19:05 ` [PATCH v4 2/7] staging: rtl8723bs: rtw_mlme: add bounds checks before ie_length subtraction Salman Alghamdi
2026-04-27 19:05 ` [PATCH v4 3/7] staging: rtl8723bs: rtw_mlme: wrap lines exceeding 100 columns Salman Alghamdi
2026-04-27 19:05 ` [PATCH v4 4/7] staging: rtl8723bs: rtw_mlme: extract local variables for long expressions Salman Alghamdi
2026-04-28  6:07   ` Luka Gejak
2026-04-28  9:10   ` Dan Carpenter
2026-04-28 11:46     ` Salman Alghamdi
2026-04-28 11:55     ` Dan Carpenter [this message]
2026-04-27 19:05 ` [PATCH v4 5/7] staging: rtl8723bs: rtw_mlme: remove dead commented-out code Salman Alghamdi
2026-04-27 19:05 ` [PATCH v4 6/7] staging: rtl8723bs: rtw_mlme: consolidate capability comparisons lines Salman Alghamdi
2026-04-27 19:05 ` [PATCH v4 7/7] staging: rtl8723bs: rtw_mlme: add blank line for readability Salman Alghamdi

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=afCgGuAShUy0RtVY@stanley.mountain \
    --to=error27@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=luka.gejak@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