From: Joe Perches <joe@perches.com>
To: Jagath Jog J <jagathjog1996@gmail.com>,
gregkh@linuxfoundation.org, hdegoede@redhat.com,
Larry.Finger@lwfinger.net
Cc: fabioaiuto83@gmail.com, dan.carpenter@oracle.com,
marcocesati@gmail.com, linux-staging@lists.linux.dev,
linux-kernel@vger.kernel.org
Subject: Re: [Patch 1/3] Staging: rtl8723bs: Placing opening { braces in previous line
Date: Tue, 25 Jan 2022 09:22:53 -0800 [thread overview]
Message-ID: <b40820130b12bedce168f70886b9ff9dd98d2b08.camel@perches.com> (raw)
In-Reply-To: <20220124034456.8665-2-jagathjog1996@gmail.com>
On Mon, 2022-01-24 at 09:14 +0530, Jagath Jog J wrote:
> Fix following checkpatch.pl error by placing opening {
> braces in previous line
> ERROR: that open brace { should be on the previous line
[]
> diff --git a/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c b/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c
[]
> @@ -113,13 +113,10 @@ static struct ieee80211_supported_band *rtw_spt_band_alloc(
> struct ieee80211_supported_band *spt_band = NULL;
> int n_channels, n_bitrates;
>
> - if (band == NL80211_BAND_2GHZ)
> - {
> + if (band == NL80211_BAND_2GHZ) {
> n_channels = RTW_2G_CHANNELS_NUM;
> n_bitrates = RTW_G_RATES_NUM;
> - }
> - else
> - {
> + } else {
> goto exit;
> }
Reversing the test would be less indented and simpler code:
if (band != NL80211_BAND_2GHZ)
goto exit;
n_channels = RTW_2G_CHANNELS_NUM;
n_bitrates = RTW_G_RATES_NUM;
etc...
next prev parent reply other threads:[~2022-01-25 17:26 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-24 3:44 [Patch 0/3] Staging: rtl8723bs: Fix codestyle errors and warnings Jagath Jog J
2022-01-24 3:44 ` [Patch 1/3] Staging: rtl8723bs: Placing opening { braces in previous line Jagath Jog J
2022-01-25 17:22 ` Joe Perches [this message]
2022-01-24 3:44 ` [Patch 2/3] Staging: rtl8723bs: Removed extra spaces between datatype and variable Jagath Jog J
2022-01-24 3:44 ` [Patch 3/3] Staging: rtl8723bs: Inserting blank line after declaration Jagath Jog J
2022-01-24 8:16 ` [Patch 0/3] Staging: rtl8723bs: Fix codestyle errors and warnings Hans de Goede
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=b40820130b12bedce168f70886b9ff9dd98d2b08.camel@perches.com \
--to=joe@perches.com \
--cc=Larry.Finger@lwfinger.net \
--cc=dan.carpenter@oracle.com \
--cc=fabioaiuto83@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=hdegoede@redhat.com \
--cc=jagathjog1996@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=marcocesati@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
all inboxes | Powered by JetHome®