All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] net: e1000: use correct hepler to do endianess conversion
@ 2015-12-21  9:04 Miao Yan
  2015-12-21  9:43 ` Bin Meng
  0 siblings, 1 reply; 4+ messages in thread
From: Miao Yan @ 2015-12-21  9:04 UTC (permalink / raw)
  To: u-boot

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.

Signed-off-by: Miao Yan <yanmiaobest@gmail.com>
---
 drivers/net/e1000.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/e1000.c b/drivers/net/e1000.c
index 2ba03ed..6124bf0 100644
--- a/drivers/net/e1000.c
+++ b/drivers/net/e1000.c
@@ -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));
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [U-Boot] [PATCH] net: e1000: use correct hepler to do endianess conversion
  2015-12-21  9:04 [U-Boot] [PATCH] net: e1000: use correct hepler to do endianess conversion Miao Yan
@ 2015-12-21  9:43 ` Bin Meng
  2015-12-21  9:53   ` Bin Meng
  0 siblings, 1 reply; 4+ messages in thread
From: Bin Meng @ 2015-12-21  9:43 UTC (permalink / raw)
  To: u-boot

On Mon, Dec 21, 2015 at 5:04 PM, Miao Yan <yanmiaobest@gmail.com> wrote:
> 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.
>
> Signed-off-by: Miao Yan <yanmiaobest@gmail.com>
> ---
>  drivers/net/e1000.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>

Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [U-Boot] [PATCH] net: e1000: use correct hepler to do endianess conversion
  2015-12-21  9:43 ` Bin Meng
@ 2015-12-21  9:53   ` Bin Meng
  2015-12-21  9:58     ` Miao Yan
  0 siblings, 1 reply; 4+ messages in thread
From: Bin Meng @ 2015-12-21  9:53 UTC (permalink / raw)
  To: u-boot

Hi Miao,

On Mon, Dec 21, 2015 at 5:43 PM, Bin Meng <bmeng.cn@gmail.com> wrote:
> On Mon, Dec 21, 2015 at 5:04 PM, Miao Yan <yanmiaobest@gmail.com> wrote:
>> 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.
>>
>> Signed-off-by: Miao Yan <yanmiaobest@gmail.com>
>> ---
>>  drivers/net/e1000.c | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>
> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

BTW: two typos,

hepler in the commit title
endianess in the commit title and body

Regards,
Bin

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [U-Boot] [PATCH] net: e1000: use correct hepler to do endianess conversion
  2015-12-21  9:53   ` Bin Meng
@ 2015-12-21  9:58     ` Miao Yan
  0 siblings, 0 replies; 4+ messages in thread
From: Miao Yan @ 2015-12-21  9:58 UTC (permalink / raw)
  To: u-boot

Hi Bin,

2015-12-21 17:53 GMT+08:00 Bin Meng <bmeng.cn@gmail.com>:
> Hi Miao,
>
> On Mon, Dec 21, 2015 at 5:43 PM, Bin Meng <bmeng.cn@gmail.com> wrote:
>> On Mon, Dec 21, 2015 at 5:04 PM, Miao Yan <yanmiaobest@gmail.com> wrote:
>>> 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.
>>>
>>> Signed-off-by: Miao Yan <yanmiaobest@gmail.com>
>>> ---
>>>  drivers/net/e1000.c | 4 ++--
>>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>>
>>
>> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
>
> BTW: two typos,
>
> hepler in the commit title
> endianess in the commit title and body

Thanks for catching these. Will send v2.


>
> Regards,
> Bin

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-12-21  9:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-21  9:04 [U-Boot] [PATCH] net: e1000: use correct hepler to do endianess conversion Miao Yan
2015-12-21  9:43 ` Bin Meng
2015-12-21  9:53   ` Bin Meng
2015-12-21  9:58     ` Miao Yan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.