From: Joe Perches <joe@perches.com>
To: Saurav Girepunje <saurav.girepunje@gmail.com>,
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: Re: [PATCH] staging: rtl8723bs: core: remove local variable and goto statement
Date: Mon, 25 Oct 2021 21:30:13 -0700 [thread overview]
Message-ID: <8a28c2abf1857c631bd6af52364d7f055a6c0ee9.camel@perches.com> (raw)
In-Reply-To: <YXeC8q6IooA4N1ZF@Sauravs-MacBook-Air.local>
On Tue, 2021-10-26 at 09:54 +0530, Saurav Girepunje wrote:
> 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.
[]
> diff --git 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;
> }
bool rtw_validate_ssid(const struct ndis_802_11_ssid *ssid)
{
return ssid->ssid_length <= 32;
}
prev parent reply other threads:[~2021-10-26 4:30 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-26 4:24 Saurav Girepunje
2021-10-26 4:30 ` Joe Perches [this message]
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=8a28c2abf1857c631bd6af52364d7f055a6c0ee9.camel@perches.com \
--to=joe@perches.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@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®