[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <8a28c2abf1857c631bd6af52364d7f055a6c0ee9.camel@perches.com>
Date: Mon, 25 Oct 2021 21:30:13 -0700
From: Joe Perches <joe@...ches.com>
To: Saurav Girepunje <saurav.girepunje@...il.com>,
gregkh@...uxfoundation.org, fabioaiuto83@...il.com,
ross.schm.dev@...il.com, marcocesati@...il.com,
matthew.v.deangelis@...il.com, linux-staging@...ts.linux.dev,
linux-kernel@...r.kernel.org
Cc: saurav.girepunje@...mail.com
Subject: Re: [PATCH] staging: rtl8723bs: core: remove local variable and
goto statement
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;
}
Powered by blists - more mailing lists