From: Andrew Lunn <and...@lunn.ch>
Date: Wed,  4 Jan 2017 19:56:24 +0100

> +static inline u64 ether_addr_to_u64(const u8 *addr)
> +{
> +     u64 u = 0;
> +     int i;
> +
> +     for (i = 0; i < ETH_ALEN; i++)
> +             u = u << 8 | addr[i];
> +
> +     return u;
> +}
 ...
> +static inline void u64_to_ether_addr(u64 u, u8 *addr)
> +{
> +     int i;
> +
> +     for (i = ETH_ALEN - 1; i >= 0; i--) {
> +             addr[i] = u & 0xff;
> +             u = u >> 8;
> +     }
> +}

I think these two routines behave differently on big vs little
endian.  And I doubt this was your intention.

Reply via email to