lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ