mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Saurav Girepunje <saurav.girepunje@gmail.com>
To: gregkh@linuxfoundation.org, fabioaiuto83@gmail.com,
	ross.schm.dev@gmail.com, marcocesati@gmail.com,
	matthew.v.deangelis@gmail.com, linux-staging@lists.linux.dev,
	linux-kernel@vger.kernel.org
Cc: saurav.girepunje@hotmail.com
Subject: [PATCH] staging: rtl8723bs: core: remove local variable and goto statement
Date: Tue, 26 Oct 2021 09:54:18 +0530	[thread overview]
Message-ID: <YXeC8q6IooA4N1ZF@Sauravs-MacBook-Air.local> (raw)

In the function rtw_validate_bssid() remove the goto statement.
As on goto exit label, function is returning without any cleanup.
In this function goto statement can be replace by simple return
statement, which will improve readability. After replacing
the goto statement local variable ret is also not needed. So
remove the ret local variable.

Signed-off-by: Saurav Girepunje <saurav.girepunje@gmail.com>
---
 drivers/staging/rtl8723bs/core/rtw_ioctl_set.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_ioctl_set.c b/drivers/staging/rtl8723bs/core/rtw_ioctl_set.c
index 8c11daff2d59..11e9421cad58 100644
--- a/drivers/staging/rtl8723bs/core/rtw_ioctl_set.c
+++ b/drivers/staging/rtl8723bs/core/rtw_ioctl_set.c
@@ -24,15 +24,10 @@ u8 rtw_validate_bssid(u8 *bssid)

 u8 rtw_validate_ssid(struct ndis_802_11_ssid *ssid)
 {
-	u8 ret = true;
-
-	if (ssid->ssid_length > 32) {
-		ret = false;
-		goto exit;
-	}
+	if (ssid->ssid_length > 32)
+		return false;

-exit:
-	return ret;
+	return true;
 }

 u8 rtw_do_join(struct adapter *padapter)
--
2.33.0


             reply	other threads:[~2021-10-26  4:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-26  4:24 Saurav Girepunje [this message]
2021-10-26  4:30 ` Joe Perches

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=YXeC8q6IooA4N1ZF@Sauravs-MacBook-Air.local \
    --to=saurav.girepunje@gmail.com \
    --cc=fabioaiuto83@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=marcocesati@gmail.com \
    --cc=matthew.v.deangelis@gmail.com \
    --cc=ross.schm.dev@gmail.com \
    --cc=saurav.girepunje@hotmail.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

all inboxes | Powered by JetHome®