]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
net: e1000: use correct helper to do endianness conversion
authorMiao Yan <yanmiaobest@gmail.com>
Mon, 21 Dec 2015 10:07:02 +0000 (02:07 -0800)
committerTom Rini <trini@konsulko.com>
Mon, 4 Jan 2016 17:25:35 +0000 (12:25 -0500)
In struct e1000_rx_desc, field 'length' is declared as
uint16_t, so use le16_to_cpu() to do endianness conversion.

Also drop conversion on 'status' which is declared as
uint8_t.

Signed-off-by: Miao Yan <yanmiaobest@gmail.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
drivers/net/e1000.c

index 2ba03ed73e45e40b177221cc47483465dba7a3cc..6124bf0ab38f0fdd1755f33f6c22d421ef915f54 100644 (file)
@@ -5165,11 +5165,11 @@ _e1000_poll(struct e1000_hw *hw)
        inval_end = inval_start + roundup(sizeof(*rd), ARCH_DMA_MINALIGN);
        invalidate_dcache_range(inval_start, inval_end);
 
-       if (!(le32_to_cpu(rd->status)) & E1000_RXD_STAT_DD)
+       if (!(rd->status & E1000_RXD_STAT_DD))
                return 0;
        /* DEBUGOUT("recv: packet len=%d\n", rd->length); */
        /* Packet received, make sure the data are re-loaded from RAM. */
-       len = le32_to_cpu(rd->length);
+       len = le16_to_cpu(rd->length);
        invalidate_dcache_range((unsigned long)packet,
                                (unsigned long)packet +
                                roundup(len, ARCH_DMA_MINALIGN));