lkml.org 
[lkml]   [2022]   [Jan]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [Patch 1/3] Staging: rtl8723bs: Placing opening { braces in previous line
From
Date
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...


\
 
 \ /
  Last update: 2022-01-25 18:28    [W:0.052 / U:0.132 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site