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]
Message-ID: <1494072867.31950.23.camel@perches.com>
Date:   Sat, 06 May 2017 05:14:27 -0700
From:   Joe Perches <joe@...ches.com>
To:     Rene Hickersberger <renehickersberger@....net>,
        gregkh@...uxfoundation.org
Cc:     hadess@...ess.net, hdegoede@...hat.com, Larry.Finger@...inger.net,
        devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] Staging: rtl8723bs: core: Fixed a brace coding style
 issue

On Sat, 2017-05-06 at 14:00 +0200, Rene Hickersberger wrote:
> Fixed a brace coding style issue.
[]
> diff --git a/drivers/staging/rtl8723bs/core/rtw_cmd.c b/drivers/staging/rtl8723bs/core/rtw_cmd.c
[]
> @@ -863,11 +863,10 @@ u8 rtw_joinbss_cmd(struct adapter  *padapter, struct wlan_network *pnetwork)
>  	auth = &psecuritypriv->authenticator_ie[0];
>  	psecuritypriv->authenticator_ie[0] = (unsigned char)psecnetwork->IELength;
>  
> -	if ((psecnetwork->IELength-12) < (256-1)) {
> +	if ((psecnetwork->IELength-12) < (256-1))
>  		memcpy(&psecuritypriv->authenticator_ie[1], &psecnetwork->IEs[12], psecnetwork->IELength-12);
> -	} else {
> +	else
>  		memcpy(&psecuritypriv->authenticator_ie[1], &psecnetwork->IEs[12], (256-1));
> -	}

Because the first 2 arguments are very long and identical,
it's probably better to not use braces but use min() instead

	memcpy(&psecuritypriv->authenticator_ie[1], &psecnetwork->IEs[12],
	       min(psecnetwork->IELength - 12, 256 - 1));

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ