[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <b40820130b12bedce168f70886b9ff9dd98d2b08.camel@perches.com>
Date: Tue, 25 Jan 2022 09:22:53 -0800
From: Joe Perches <joe@...ches.com>
To: Jagath Jog J <jagathjog1996@...il.com>, gregkh@...uxfoundation.org,
hdegoede@...hat.com, Larry.Finger@...inger.net
Cc: fabioaiuto83@...il.com, dan.carpenter@...cle.com,
marcocesati@...il.com, linux-staging@...ts.linux.dev,
linux-kernel@...r.kernel.org
Subject: Re: [Patch 1/3] Staging: rtl8723bs: Placing opening { braces in
previous line
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...
Powered by blists - more mailing lists