net: fec: use swab32s() instead of cpu_to_be32()
authorLothar Waßmann <LW@KARO-electronics.de>
Mon, 17 Nov 2014 09:51:22 +0000 (10:51 +0100)
committerDavid S. Miller <davem@davemloft.net>
Tue, 18 Nov 2014 20:19:32 +0000 (15:19 -0500)
when swap_buffer() is being called, we know for sure, that we need to
byte swap the data. Furthermore, this function is called for swapping
data in both directions. Thus cpu_to_be32() is semantically not
correct for all use cases. Use swab32s() to reflect this.

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 3884dd9de3a437806ed01fb38d9e4dac6ce088a0..f73fee781e0b285a548d5f3ac3c768b66aeff608 100644 (file)
@@ -293,7 +293,7 @@ static void *swap_buffer(void *bufaddr, int len)
        unsigned int *buf = bufaddr;
 
        for (i = 0; i < DIV_ROUND_UP(len, 4); i++, buf++)
-               *buf = cpu_to_be32(*buf);
+               swab32s(buf);
 
        return bufaddr;
 }