Browse Source

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@KARO-electronics.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Lothar Waßmann 10 years ago
parent
commit
7b487d070a
1 changed files with 1 additions and 1 deletions
  1. 1 1
      drivers/net/ethernet/freescale/fec_main.c

+ 1 - 1
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;