Skip to contentSkip to conversation

net: e1000: use correct helper to do endianness conversion

PATCH New Miao Yan 3 participants 3 messages Dec 21, 2015 – Jan 4, 2016 Network drivers

lore
Share & tools
lore

Miao Yan

author
#0 lore raw

PATCH v2 1/1 net: e1000: use correct helper to do endianness conversion

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.

---
Changes in v2:
- fix typos in commit message

 drivers/net/e1000.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/e1000.c +2 -2
index 2ba03ed..6124bf0 100644
@@ -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
#1 lore raw

PATCH v2 1/1 net: e1000: use correct helper to do endianness conversion

Quoted 6 lines · Miao Yan

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.

Quoted 8 lines

---
Changes in v2:
- fix typos in commit message

 drivers/net/e1000.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
#2 lore raw

PATCH v2 1/1 net: e1000: use correct helper to do endianness conversion

In reply to Miao Yan
Quoted 8 lines · Miao Yan

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.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160104/b451bb0d/attachment.sig>