net: fec: simplify loop counter handling in swap_buffer()
authorLothar Waßmann <LW@KARO-electronics.de>
Mon, 17 Nov 2014 09:51:23 +0000 (10:51 +0100)
committerDavid S. Miller <davem@davemloft.net>
Tue, 18 Nov 2014 20:19:32 +0000 (15:19 -0500)
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>
drivers/net/ethernet/freescale/fec_main.c

index f73fee781e0b285a548d5f3ac3c768b66aeff608..dbccdf37e2e418dc25097e571705d24a4aadf51e 100644 (file)
@@ -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;