All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] net: usb: mcs7830: fix no DM recive path
@ 2017-05-17 14:55 Uri Mashiach
  2017-05-17 15:29 ` Marek Vasut
  0 siblings, 1 reply; 2+ messages in thread
From: Uri Mashiach @ 2017-05-17 14:55 UTC (permalink / raw)
  To: u-boot

Modifications:
* The call condition of the function net_process_received_packet() is
  the success of the function mcs7830_recv_common().
* The return value of the function mcs7830_recv reflects the success of
  the function mcs7830_recv_common().

Signed-off-by: Uri Mashiach <uri.mashiach@compulab.co.il>
---
 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

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

* [U-Boot] [PATCH] net: usb: mcs7830: fix no DM recive path
  2017-05-17 14:55 [U-Boot] [PATCH] net: usb: mcs7830: fix no DM recive path Uri Mashiach
@ 2017-05-17 15:29 ` Marek Vasut
  0 siblings, 0 replies; 2+ messages in thread
From: Marek Vasut @ 2017-05-17 15:29 UTC (permalink / raw)
  To: u-boot

On 05/17/2017 04:55 PM, Uri Mashiach wrote:
> Modifications:
> * The call condition of the function net_process_received_packet() is
>   the success of the function mcs7830_recv_common().
> * The return value of the function mcs7830_recv reflects the success of
>   the function mcs7830_recv_common().

Can you rewrite the commit message such that it's clear what you're
doing here ? The mcs7830_recv_common() probably returns negative on
error, 0 or positive on success, right ?

> Signed-off-by: Uri Mashiach <uri.mashiach@compulab.co.il>
> ---
>  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

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

end of thread, other threads:[~2017-05-17 15:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-17 14:55 [U-Boot] [PATCH] net: usb: mcs7830: fix no DM recive path Uri Mashiach
2017-05-17 15:29 ` Marek Vasut

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.