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]
Date:	Wed, 11 Mar 2015 13:19:42 -0700
From:	Joe Perches <joe@...ches.com>
To:	Priit Laes <plaes@...es.org>
Cc:	Kalle Valo <kvalo@...eaurora.org>,
	Larry Finger <Larry.Finger@...inger.net>,
	linux-wireless@...r.kernel.org, netdev@...r.kernel.org,
	Chaoming Li <chaoming_li@...lsil.com.cn>
Subject: Re: [PATCH 1/6] rtlwifi: Use common rtl_query_rxpwrpercentage
 function

On Wed, 2015-03-11 at 22:03 +0200, Priit Laes wrote:
> diff --git a/drivers/net/wireless/rtlwifi/stats.c b/drivers/net/wireless/rtlwifi/stats.c
[]
> @@ -26,14 +26,14 @@
>  #include "stats.h"
>  #include <linux/export.h>
>  
> +/* TODO: Figure out a better name */
>  u8 rtl_query_rxpwrpercentage(char antpower)
>  {
>  	if ((antpower <= -100) || (antpower >= 20))
>  		return 0;
>  	else if (antpower >= 0)
>  		return 100;
> -	else
> -		return 100 + antpower;
> +	return 100 + antpower;
> }

This is a superfluous change.

If it was changed because checkpatch emitted a warning,
there's a newer version of checkpatch that doesn't emit
a warning for this line.

If any change was to be made, I suggest reordering so
that the return values are written low to high like:

u8 rtl_query_rxpwrpercentage(char antpower)
{
	if ((antpower <= -100) || (antpower >= 20))
		return 0;
	else if (antpower < 0)
		return antpower + 100;
	else
		return 100;
}


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ