[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1416217884-20911-8-git-send-email-LW@KARO-electronics.de>
Date: Mon, 17 Nov 2014 10:51:23 +0100
From: Lothar Waßmann <LW@...O-electronics.de>
To: "David S. Miller" <davem@...emloft.net>
Cc: Lothar Waßmann <LW@...O-electronics.de>,
netdev@...r.kernel.org, Frank Li <Frank.Li@...escale.com>,
Fugang Duan <fugang.duan@...escale.com>,
Russell King <rmk+kernel@....linux.org.uk>
Subject: [PATCH 7/8] net: fec: simplify loop counter handling in swap_buffer()
Eliminate the DIV_ROUND_UP() and change the loop counter increment to
4 instead. This results in saving 6 instructions in the functions
assembly code.
Signed-off-by: Lothar Waßmann <LW@...O-electronics.de>
---
drivers/net/ethernet/freescale/fec_main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
index f73fee7..dbccdf3 100644
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -292,7 +292,7 @@ static void *swap_buffer(void *bufaddr, int len)
int i;
unsigned int *buf = bufaddr;
- for (i = 0; i < DIV_ROUND_UP(len, 4); i++, buf++)
+ for (i = 0; i < len; i += 4, buf++)
swab32s(buf);
return bufaddr;
--
1.7.10.4
--
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