net: e1000: use correct hepler to do endianess conversion
PATCH 1/1 net: e1000: use correct hepler to do endianess conversion
In struct e1000_rx_desc, field 'length' is declared as uint16_t, so use le16_to_cpu() to do endianess conversion.
Also drop conversion on 'status' which is declared as uint8_t.
--- drivers/net/e1000.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/e1000.c +2 -2
@@ -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 ));
Signature · 1 line
1.9.1
PATCH 1/1 net: e1000: use correct hepler to do endianess conversion
Quoted 11 lines · Miao Yan
In struct
e1000_rx_desc, field 'length' is declared asuint16_t, so usele16_to_cpu()to do endianess conversion.Also drop conversion on 'status' which is declared as
uint8_t.Signed-off-by Miao Yan <[email protected]>--- drivers/net/e1000.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
PATCH 1/1 net: e1000: use correct hepler to do endianess conversion
Hi Miao,
Quoted 7 lines · Bin Meng
Quoted 6 lines · Miao Yan
In struct
e1000_rx_desc, field 'length' is declared asuint16_t, so usele16_to_cpu()to do endianess conversion.Also drop conversion on 'status' which is declared as
uint8_t.
Quoted 7 lines
Quoted 5 lines
Signed-off-by Miao Yan <[email protected]>--- drivers/net/e1000.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)Reviewed-by Bin Meng <[email protected]>
BTW: two typos,
hepler in the commit title
endianess in the commit title and body
Regards,
Bin
PATCH 1/1 net: e1000: use correct hepler to do endianess conversion
Hi Bin,
2015-12-21 17:53 GMT+08:00 Bin Meng <[email protected]>:
Quoted 16 lines
Hi Miao,
Quoted 13 lines · Bin Meng
Quoted 11 lines · Miao Yan
In struct
e1000_rx_desc, field 'length' is declared asuint16_t, so usele16_to_cpu()to do endianess conversion.Also drop conversion on 'status' which is declared as
uint8_t.Signed-off-by Miao Yan <[email protected]>--- drivers/net/e1000.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Quoted 6 lines
Quoted 1 line
Reviewed-by Bin Meng <[email protected]>BTW: two typos,
hepler in the commit title
endianess in the commit title and body
Thanks for catching these. Will send v2.
Quoted 3 lines
Regards,
Bin