Re: [U-Boot] [PATCH v4] net: usb: mcs7830: fix non-DM ingress path

2017-05-21 Thread Marek Vasut
On 05/21/2017 04:00 PM, Uri Mashiach wrote:
> The mcs7830_recv() (non-DM) function discards good packets and tries to
> process "bad" packets due to incorrect test condition.
> Fix the condition and return the proper value as described in function
> doc.
> 
> Signed-off-by: Uri Mashiach 
> Acked-by: Igor Grinberg 

Applied, thanks

> ---
> v1 -> v4: update the commit message.
> 
>  drivers/usb/eth/mcs7830.c | 6 --
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/usb/eth/mcs7830.c b/drivers/usb/eth/mcs7830.c
> index 9d6cf8c..4abef5d 100644
> --- a/drivers/usb/eth/mcs7830.c
> +++ b/drivers/usb/eth/mcs7830.c
> @@ -622,10 +622,12 @@ static int mcs7830_recv(struct eth_device *eth)
>   int len;
>  
>   len = mcs7830_recv_common(ueth, buf);
> - if (len <= 0)
> + if (len >= 0) {
>   net_process_received_packet(buf, len);
> + return 0;
> + }
>  
> - return 0;
> + return len;
>  }
>  
>  /*
> 


-- 
Best regards,
Marek Vasut
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v4] net: usb: mcs7830: fix non-DM ingress path

2017-05-21 Thread Uri Mashiach
The mcs7830_recv() (non-DM) function discards good packets and tries to
process "bad" packets due to incorrect test condition.
Fix the condition and return the proper value as described in function
doc.

Signed-off-by: Uri Mashiach 
Acked-by: Igor Grinberg 
---
v1 -> v4: update the commit message.

 drivers/usb/eth/mcs7830.c | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/eth/mcs7830.c b/drivers/usb/eth/mcs7830.c
index 9d6cf8c..4abef5d 100644
--- a/drivers/usb/eth/mcs7830.c
+++ b/drivers/usb/eth/mcs7830.c
@@ -622,10 +622,12 @@ static int mcs7830_recv(struct eth_device *eth)
int len;
 
len = mcs7830_recv_common(ueth, buf);
-   if (len <= 0)
+   if (len >= 0) {
net_process_received_packet(buf, len);
+   return 0;
+   }
 
-   return 0;
+   return len;
 }
 
 /*
-- 
2.7.4

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot