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] [thread-next>] [day] [month] [year] [list]
Message-ID: <1cac230f14153984edd5f0d165e8a84b639a6796.camel@perches.com>
Date:   Sun, 22 May 2022 13:03:09 -0700
From:   Joe Perches <joe@...ches.com>
To:     Hannes Braun <hannesbraun@...l.de>, gregkh@...uxfoundation.org,
        hdegoede@...hat.com, Larry.Finger@...inger.net
Cc:     linux-staging@...ts.linux.dev, linux-kernel@...r.kernel.org,
        fabioaiuto83@...il.com, dan.carpenter@...cle.com
Subject: Re: [PATCH] staging: rtl8723bs: fix placement of braces

On Sun, 2022-05-22 at 18:06 +0200, Hannes Braun wrote:
> This patch should eliminate the following errors/warnings emitted by
> checkpatch.pl:
> - that open brace { should be on the previous line
> - else should follow close brace '}'
> - braces {} are not necessary for single statement blocks
[] 
> diff --git a/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c b/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c
[]
> @@ -746,20 +719,17 @@ static int rtw_cfg80211_set_encryption(struct net_device *dev, struct ieee_param
[]
>  	if (param->sta_addr[0] == 0xff && param->sta_addr[1] == 0xff &&
>  	    param->sta_addr[2] == 0xff && param->sta_addr[3] == 0xff &&
> -	    param->sta_addr[4] == 0xff && param->sta_addr[5] == 0xff)
> -	{
> +	    param->sta_addr[4] == 0xff && param->sta_addr[5] == 0xff) {
>  		if (param->u.crypt.idx >= WEP_KEYS
>  			|| param->u.crypt.idx >= BIP_MAX_KEYID
> -		)
> -		{
> +		) {

This one's a bit of an oddity as the close paren and open brace
should be on the line above.

additional trivia:

The tests could be changed in a separate patch to something like:

	if (is_broadcast_ether_addr(param->sta_addr)) {
		if (param->u.crypt.idx >= WEP_KEYS ||
		    param->u.crypt.idx >= BIP_MAX_KEYID) {

or maybe

	if (is_broadcast_ether_addr(param->sta_addr)) {
		if (param->u.crypt.idx >= min(WEP_KEYS, BIP_MAX_KEYID)) {


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ