From: Mugunthan V N <mugunthanvnm@ti.com>
To: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: <tglx@linutronix.de>, <netdev@vger.kernel.org>,
"David S. Miller" <davem@davemloft.net>
Subject: Re: [PATCH 3/4] net/cpsw: optimize the for_each_slave_macro()
Date: Thu, 25 Apr 2013 12:01:24 +0530 [thread overview]
Message-ID: <5178CDBC.8030208@ti.com> (raw)
In-Reply-To: <1366829305-9752-4-git-send-email-bigeasy@linutronix.de>
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@linutronix.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@ti.com>
Regards
Mugunthan V N
next prev parent reply other threads:[~2013-04-25 6:32 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-24 18:48 Second batch of cpsw patches Sebastian Andrzej Siewior
2013-04-24 18:48 ` [PATCH 1/4] net/ti: add MODULE_DEVICE_TABLE + MODULE_LICENSE Sebastian Andrzej Siewior
2013-04-25 6:29 ` Mugunthan V N
2013-04-24 18:48 ` [PATCH 2/4] net/cpsw: make sure modules remove does not leak any ressources Sebastian Andrzej Siewior
2013-04-25 6:31 ` Mugunthan V N
2013-04-25 12:47 ` Sergei Shtylyov
2013-04-24 18:48 ` [PATCH 3/4] net/cpsw: optimize the for_each_slave_macro() Sebastian Andrzej Siewior
2013-04-25 6:31 ` Mugunthan V N [this message]
2013-04-24 18:48 ` [PATCH 4/4] net/cpsw: fix irq_disable() with threaded interrupts Sebastian Andrzej Siewior
2013-04-25 6:35 ` Mugunthan V N
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5178CDBC.8030208@ti.com \
--to=mugunthanvnm@ti.com \
--cc=bigeasy@linutronix.de \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.