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:	Thu, 25 Apr 2013 12:01:24 +0530
From:	Mugunthan V N <mugunthanvnm@...com>
To:	Sebastian Andrzej Siewior <bigeasy@...utronix.de>
CC:	<tglx@...utronix.de>, <netdev@...r.kernel.org>,
	"David S. Miller" <davem@...emloft.net>
Subject: Re: [PATCH 3/4] net/cpsw: optimize the for_each_slave_macro()

On 4/25/2013 12:18 AM, Sebastian Andrzej Siewior wrote:
>   text    data     bss     dec     hex filename
> 15530      92       4   15626    3d0a cpsw.o.before
> 15478      92       4   15574    3cd6 cpsw.o.after
>
> 52 bytes smaller, 13 for each invocation.
>
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@...utronix.de>
> ---
>   drivers/net/ethernet/ti/cpsw.c |    9 ++++++---
>   1 file changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c
> index 1983f23..8b643d9 100644
> --- a/drivers/net/ethernet/ti/cpsw.c
> +++ b/drivers/net/ethernet/ti/cpsw.c
> @@ -355,12 +355,15 @@ struct cpsw_priv {
>   #define napi_to_priv(napi)	container_of(napi, struct cpsw_priv, napi)
>   #define for_each_slave(priv, func, arg...)				\
>   	do {								\
> -		int idx;						\
> +		struct cpsw_slave *slave;				\
> +		int n;							\
>   		if (priv->data.dual_emac)				\
>   			(func)((priv)->slaves + priv->emac_port, ##arg);\
>   		else							\
> -			for (idx = 0; idx < (priv)->data.slaves; idx++)	\
> -				(func)((priv)->slaves + idx, ##arg);	\
> +			for (n = (priv)->data.slaves,			\
> +					slave = (priv)->slaves;		\
> +					n; n--)				\
> +				(func)(slave++, ##arg);			\
>   	} while (0)
>   #define cpsw_get_slave_ndev(priv, __slave_no__)				\
>   	(priv->slaves[__slave_no__].ndev)

Acked-by: Mugunthan V N <mugunthanvnm@...com>

Regards
Mugunthan V N
--
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