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:	Tue, 9 Aug 2016 14:34:17 +0300
From:	Grygorii Strashko <grygorii.strashko@...com>
To:	Ivan Khoronzhuk <ivan.khoronzhuk@...aro.org>,
	<netdev@...r.kernel.org>, <mugunthanvnm@...com>
CC:	<linux-omap@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
	<dlide@...com>
Subject: Re: [PATCH v2 05/14] net: ethernet: ti: cpsw: don't check slave num
 in runtime

On 08/06/2016 01:48 PM, Ivan Khoronzhuk wrote:
> No need to check const slave num in runtime for every packet,
> and ndev for slaves w/o ndev is anyway NULL. So remove redundant
> check.
> 
> Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@...aro.org>
> ---
>  drivers/net/ethernet/ti/cpsw.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c
> index 70a9570..19aa4bb 100644
> --- a/drivers/net/ethernet/ti/cpsw.c
> +++ b/drivers/net/ethernet/ti/cpsw.c
> @@ -498,8 +498,7 @@ static const struct cpsw_stats cpsw_gstrings_stats[] = {
>  				(func)(slave++, ##arg);			\
>  	} while (0)
>  #define cpsw_get_slave_ndev(priv, __slave_no__)				\
> -	((__slave_no__ < priv->data.slaves) ?				\
> -		priv->slaves[__slave_no__].ndev : NULL)
> +		priv->slaves[__slave_no__].ndev

So after this change it will be
#define cpsw_get_slave_ndev(priv, __slave_no__) priv->slaves[__slave_no__].ndev

Can we just drop cpsw_get_slave_ndev() macro?

>  #define cpsw_get_slave_priv(priv, __slave_no__)				\
>  	(((__slave_no__ < priv->data.slaves) &&				\
>  		(priv->slaves[__slave_no__].ndev)) ?			\
> 


-- 
regards,
-grygorii

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ